diff options
author | Alexandra Khirnova <alexandra.khirnova@gmail.com> | 2013-09-18 18:12:36 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-09-18 18:28:38 +0200 |
commit | 5626f994f273af80fb100d4743b963304de9e05c (patch) | |
tree | 69a48a5383a83d06f8e25df3098cce219788e873 /libavformat/smacker.c | |
parent | 0f310a6f333b016d336674d086045e8473fdf918 (diff) | |
download | ffmpeg-5626f994f273af80fb100d4743b963304de9e05c.tar.gz |
avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
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 f8a0769acd..e68c3fd467 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -305,7 +305,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 > frame_size) { @@ -315,10 +315,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) |