[FFmpeg-devel] [PATCH 23/41] avformat/bink: use ff_alloc_extradata()

Paul B Mahol onemda at gmail.com
Sun Oct 13 14:48:44 CEST 2013


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavformat/bink.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavformat/bink.c b/libavformat/bink.c
index 887f70a..6db73cc 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -116,10 +116,8 @@ static int read_header(AVFormatContext *s)
 
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     vst->codec->codec_id   = AV_CODEC_ID_BINKVIDEO;
-    vst->codec->extradata  = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
-    if (!vst->codec->extradata)
+    if (ff_alloc_extradata(vst->codec, 4))
         return AVERROR(ENOMEM);
-    vst->codec->extradata_size = 4;
     avio_read(pb, vst->codec->extradata, 4);
 
     bink->num_audio_tracks = avio_rl32(pb);
@@ -152,10 +150,8 @@ static int read_header(AVFormatContext *s)
                 ast->codec->channels       = 1;
                 ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
             }
-            ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!ast->codec->extradata)
+            if (ff_alloc_extradata(ast->codec, 4))
                 return AVERROR(ENOMEM);
-            ast->codec->extradata_size = 4;
             AV_WL32(ast->codec->extradata, vst->codec->codec_tag);
         }
 
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list