[FFmpeg-devel] [PATCH 07/41] avformat/wavdec: use ff_alloc_extradata()

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


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

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index ef28349..8ae7b45 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -353,10 +353,7 @@ static int wav_read_header(AVFormatContext *s)
             vst->codec->codec_id = AV_CODEC_ID_SMVJPEG;
             vst->codec->width  = avio_rl24(pb);
             vst->codec->height = avio_rl24(pb);
-            vst->codec->extradata_size = 4;
-            vst->codec->extradata = av_malloc(vst->codec->extradata_size +
-                                              FF_INPUT_BUFFER_PADDING_SIZE);
-            if (!vst->codec->extradata) {
+            if (ff_alloc_extradata(vst->codec, 4)) {
                 av_log(s, AV_LOG_ERROR, "Could not allocate extradata.\n");
                 return AVERROR(ENOMEM);
             }
-- 
1.7.11.2



More information about the ffmpeg-devel mailing list