avcodec/vp3: Do not return random positive values but the buf size
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 15 Dec 2016 20:08:48 +0000 (21:08 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 3 Mar 2017 16:17:53 +0000 (17:17 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/vp3.c

index fa749be..86e5852 100644 (file)
@@ -2022,8 +2022,9 @@ static int vp3_decode_frame(AVCodecContext *avctx,
                 ret = vp3_decode_init(avctx);
             if (ret < 0) {
                 vp3_decode_end(avctx);
+                return ret;
             }
-            return ret;
+            return buf_size;
         } else if (type == 2) {
             vp3_decode_end(avctx);
             ret = theora_decode_tables(avctx, &gb);
@@ -2031,8 +2032,9 @@ static int vp3_decode_frame(AVCodecContext *avctx,
                 ret = vp3_decode_init(avctx);
             if (ret < 0) {
                 vp3_decode_end(avctx);
+                return ret;
             }
-            return ret;
+            return buf_size;
         }
 
         av_log(avctx, AV_LOG_ERROR,