Mercurial > libavformat.hg
changeset 4761:a079bfd0192b libavformat
protect realloc overflow
author | bcoudurier |
---|---|
date | Sat, 21 Mar 2009 00:50:51 +0000 |
parents | 9a8c5a8c64ea |
children | af176c4a2ad2 |
files | mxfdec.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mxfdec.c Sat Mar 21 00:49:14 2009 +0000 +++ b/mxfdec.c Sat Mar 21 00:50:51 2009 +0000 @@ -364,6 +364,8 @@ static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set) { + if (mxf->metadata_sets_count+1 >= UINT_MAX / sizeof(*mxf->metadata_sets)) + return AVERROR(ENOMEM); mxf->metadata_sets = av_realloc(mxf->metadata_sets, (mxf->metadata_sets_count + 1) * sizeof(*mxf->metadata_sets)); if (!mxf->metadata_sets) return -1;