[FFmpeg-devel] [PATCH 33/41] avformat/dfa: use ff_alloc_extradata()

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


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

diff --git a/libavformat/dfa.c b/libavformat/dfa.c
index 5799d98..12516af 100644
--- a/libavformat/dfa.c
+++ b/libavformat/dfa.c
@@ -64,8 +64,8 @@ static int dfa_read_header(AVFormatContext *s)
     avio_skip(pb, 128 - 16); // padding
     st->duration = frames;
 
-    st->codec->extradata = av_malloc(2);
-    st->codec->extradata_size = 2;
+    if (ff_alloc_extradata(st->codec, 2))
+        return AVERROR(ENOMEM);
     AV_WL16(st->codec->extradata, version);
     if (version == 0x100)
         st->sample_aspect_ratio = (AVRational){2, 1};
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list