[FFmpeg-cvslog] avcodec/vc1dec: Fix return code on malloc() failure from ff_vc1_decode_init_alloc_tables()

Michael Niedermayer git at videolan.org
Mon Sep 23 15:03:51 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Sep 23 14:53:48 2013 +0200| [a51f3b53fe7f96a15af4dd6fbdb9a084e89a4321] | committer: Michael Niedermayer

avcodec/vc1dec: Fix return code on malloc() failure from ff_vc1_decode_init_alloc_tables()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a51f3b53fe7f96a15af4dd6fbdb9a084e89a4321
---

 libavcodec/vc1dec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e992640..1f09033 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5534,7 +5534,8 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
 
     if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
         for (i = 0; i < 4; i++)
-            if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width))) return -1;
+            if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
+                return AVERROR(ENOMEM);
     }
 
     if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane ||



More information about the ffmpeg-cvslog mailing list