aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-30 22:12:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-03-30 23:35:18 +0200
commitfe46d92c15ca7bd35324ff667c433a06af8b845c (patch)
tree230168d176b737c79334c79e0f410d5158d2648d /libavcodec
parent2a68d3b1a5082901a0678f7c15374053630757a9 (diff)
downloadffmpeg-fe46d92c15ca7bd35324ff667c433a06af8b845c.tar.gz
avcodec/clearvideo: Do not lose the return code of decode_mb()
Fixes CID1401671 Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/clearvideo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index e2644e3090..437c459aa5 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,9 @@ 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);
+ ret = decode_mb(c, i, j);
+ if (ret < 0)
+ mb_ret = ret;
}
}
} else {
@@ -323,7 +326,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)