diff mbox

[FFmpeg-devel] avcodec/clearvideo: Do not loose the return code of decode_mb()

Message ID 20170330171142.29201-1-michael@niedermayer.cc
State Superseded
Headers show

Commit Message

Michael Niedermayer March 30, 2017, 5:11 p.m. UTC
Fixes CID1401671

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/clearvideo.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index e2644e3090..b49e22156a 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -281,6 +281,7 @@  static int clv_decode_frame(AVCodecContext *avctx, void *data,
     uint32_t frame_type;
     int i, j;
     int ret;
+    int mb_ret = 0;
 
     bytestream2_init(&gb, buf, buf_size);
     if (avctx->codec_tag == MKTAG('C','L','V','1')) {
@@ -312,7 +313,7 @@  static int clv_decode_frame(AVCodecContext *avctx, void *data,
 
         for (j = 0; j < c->mb_height; j++) {
             for (i = 0; i < c->mb_width; i++) {
-                ret |= decode_mb(c, i, j);
+                mb_ret |= decode_mb(c, i, j);
             }
         }
     } else {
@@ -323,7 +324,7 @@  static int clv_decode_frame(AVCodecContext *avctx, void *data,
 
     *got_frame = 1;
 
-    return ret < 0 ? ret : buf_size;
+    return mb_ret < 0 ? mb_ret : buf_size;
 }
 
 static av_cold int clv_decode_init(AVCodecContext *avctx)