[FFmpeg-cvslog] avcodec/vc1dec: Fix "return -1" cases

Michael Niedermayer git at videolan.org
Fri Apr 24 02:12:34 EEST 2020


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Tue Dec 17 00:04:23 2019 +0100| [27846766d8580c314f7cfcbc569b521c11170a64] | committer: Michael Niedermayer

avcodec/vc1dec: Fix "return -1" cases

Reviewed-by: "mypopy at gmail.com" <mypopy at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 26f040bcb4a1db78d1311af2e69de6984ecb43e5)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/vc1dec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 7317e9826b..3a4936c831 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -427,7 +427,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
     v->output_height = avctx->height;
 
     if (!avctx->extradata_size || !avctx->extradata)
-        return -1;
+        return AVERROR_INVALIDDATA;
     v->s.avctx = avctx;
 
     if ((ret = ff_vc1_init_common(v)) < 0)
@@ -468,7 +468,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
 
         if (avctx->extradata_size < 16) {
             av_log(avctx, AV_LOG_ERROR, "Extradata size too small: %i\n", avctx->extradata_size);
-            return -1;
+            return AVERROR_INVALIDDATA;
         }
 
         buf2  = av_mallocz(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
@@ -504,7 +504,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
         av_free(buf2);
         if (!seq_initialized || !ep_initialized) {
             av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
-            return -1;
+            return AVERROR_INVALIDDATA;
         }
         v->res_sprite = (avctx->codec_id == AV_CODEC_ID_VC1IMAGE);
     }
@@ -573,7 +573,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
             v->sprite_height > 1 << 14 ||
             v->output_width  > 1 << 14 ||
             v->output_height > 1 << 14) {
-            ret = -1;
+            ret = AVERROR_INVALIDDATA;
             goto error;
         }
 



More information about the ffmpeg-cvslog mailing list