diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 11:01:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 11:01:26 +0200 |
commit | 20dfab33f5ab61fc51de65192ed239f8b62782a2 (patch) | |
tree | f5164b3f79ab48e4dd4c027bef968666f7748716 /libavformat/smacker.c | |
parent | f54d751f33375054d4ecf30301ef008c8e781f99 (diff) | |
parent | 5626f994f273af80fb100d4743b963304de9e05c (diff) | |
download | ffmpeg-20dfab33f5ab61fc51de65192ed239f8b62782a2.tar.gz |
Merge commit '5626f994f273af80fb100d4743b963304de9e05c'
* commit '5626f994f273af80fb100d4743b963304de9e05c':
avformat: Use av_reallocp() where suitable
Conflicts:
libavformat/avidec.c
libavformat/avienc.c
libavformat/aviobuf.c
libavformat/oggparsevorbis.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r-- | libavformat/smacker.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 7279f95a19..b9bb07e884 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -314,7 +314,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) for(i = 0; i < 7; i++) { if(flags & 1) { uint32_t size; - uint8_t *tmpbuf; + int err; size = avio_rl32(s->pb) - 4; if (!size || size + 4L > frame_size) { @@ -324,10 +324,8 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) frame_size -= size; frame_size -= 4; smk->curstream++; - tmpbuf = av_realloc(smk->bufs[smk->curstream], size); - if (!tmpbuf) - return AVERROR(ENOMEM); - smk->bufs[smk->curstream] = tmpbuf; + if ((err = av_reallocp(&smk->bufs[smk->curstream], size)) < 0) + return err; smk->buf_sizes[smk->curstream] = size; ret = avio_read(s->pb, smk->bufs[smk->curstream], size); if(ret != size) |