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/oggparsetheora.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/oggparsetheora.c')
-rw-r--r-- | libavformat/oggparsetheora.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index ed31d539d9..94e9eba35c 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -42,7 +42,7 @@ theora_header (AVFormatContext * s, int idx) struct ogg_stream *os = ogg->streams + idx; AVStream *st = s->streams[idx]; struct theora_params *thp = os->private; - int cds = st->codec->extradata_size + os->psize + 2; + int cds = st->codec->extradata_size + os->psize + 2, err; uint8_t *cdp; if(!(os->buf[os->pstart] & 0x80)) @@ -123,8 +123,9 @@ theora_header (AVFormatContext * s, int idx) return -1; } - st->codec->extradata = av_realloc (st->codec->extradata, - cds + FF_INPUT_BUFFER_PADDING_SIZE); + if ((err = av_reallocp(&st->codec->extradata, + cds + FF_INPUT_BUFFER_PADDING_SIZE)) < 0) + return err; cdp = st->codec->extradata + st->codec->extradata_size; *cdp++ = os->psize >> 8; *cdp++ = os->psize & 0xff; |