diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-13 18:44:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-15 01:27:36 +0200 |
commit | b9ce43625c43fe56aa2db726e147929380411790 (patch) | |
tree | 5626aa18a1b0bebab86e03d8c8e4e2054eb6e17d | |
parent | 426a322aa2bfd8ec28e467743c79dad81c63c108 (diff) | |
download | ffmpeg-b9ce43625c43fe56aa2db726e147929380411790.tar.gz |
avcodec/cavsdec: Check P/B frame mb decode which return error codes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/cavsdec.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 02b3d213a9..06c752735e 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1090,10 +1090,12 @@ static int decode_pic(AVSContext *h) } else { mb_type = get_ue_golomb(&h->gb) + P_SKIP + h->skip_mode_flag; if (mb_type > P_8X8) - decode_mb_i(h, mb_type - P_8X8 - 1); + ret = decode_mb_i(h, mb_type - P_8X8 - 1); else decode_mb_p(h, mb_type); } + if (ret < 0) + break; } while (ff_cavs_next_mb(h)); } else { /* AV_PICTURE_TYPE_B */ do { @@ -1102,14 +1104,16 @@ static int decode_pic(AVSContext *h) if (h->skip_mode_flag && (skip_count < 0)) skip_count = get_ue_golomb(&h->gb); if (h->skip_mode_flag && skip_count--) { - decode_mb_b(h, B_SKIP); + ret = decode_mb_b(h, B_SKIP); } else { mb_type = get_ue_golomb(&h->gb) + B_SKIP + h->skip_mode_flag; if (mb_type > B_8X8) - decode_mb_i(h, mb_type - B_8X8 - 1); + ret = decode_mb_i(h, mb_type - B_8X8 - 1); else - decode_mb_b(h, mb_type); + ret = decode_mb_b(h, mb_type); } + if (ret < 0) + break; } while (ff_cavs_next_mb(h)); } emms_c(); |