avformat: use ff_alloc_extradata()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol
2013-10-13 10:30:59 +00:00
parent 3fd79833e2
commit a807c68253
52 changed files with 83 additions and 218 deletions

View File

@@ -86,11 +86,9 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si
{
if (size >= 1<<24)
return -1;
avctx->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata)
if (ff_alloc_extradata(avctx, size))
return AVERROR(ENOMEM);
avctx->extradata_size = avio_read(pb, avctx->extradata, size);
memset(avctx->extradata + avctx->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
if (avctx->extradata_size != size)
return AVERROR(EIO);
return 0;