aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-22 15:58:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-22 16:11:02 +0200
commita5cbf1991c3d04b0be3c23ee0a7096b5a365cc85 (patch)
tree7fb1b1a2c470bbcca35193ba59d3ce15d626505b
parent2aa8e33d7d86fbc4a4060c363a5733067c160654 (diff)
downloadffmpeg-a5cbf1991c3d04b0be3c23ee0a7096b5a365cc85.tar.gz
avformat/mov: reset extradata size when extradata gets deallocated due to realloc failure
This prevents the fields from becoming inconsistent Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4b7b4c3b6f..895af18576 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -993,8 +993,10 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,
size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE;
if (size > INT_MAX || (uint64_t)atom.size > INT_MAX)
return AVERROR_INVALIDDATA;
- if ((err = av_reallocp(&st->codec->extradata, size)) < 0)
+ if ((err = av_reallocp(&st->codec->extradata, size)) < 0) {
+ st->codec->extradata_size = 0;
return err;
+ }
buf = st->codec->extradata + st->codec->extradata_size;
st->codec->extradata_size= size - FF_INPUT_BUFFER_PADDING_SIZE;
AV_WB32( buf , atom.size + 8);