avcodec/cavsdec: Check P/B frame mb decode which return error codes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1090,10 +1090,12 @@ static int decode_pic(AVSContext *h)
|
|||||||
} else {
|
} else {
|
||||||
mb_type = get_ue_golomb(&h->gb) + P_SKIP + h->skip_mode_flag;
|
mb_type = get_ue_golomb(&h->gb) + P_SKIP + h->skip_mode_flag;
|
||||||
if (mb_type > P_8X8)
|
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
|
else
|
||||||
decode_mb_p(h, mb_type);
|
decode_mb_p(h, mb_type);
|
||||||
}
|
}
|
||||||
|
if (ret < 0)
|
||||||
|
break;
|
||||||
} while (ff_cavs_next_mb(h));
|
} while (ff_cavs_next_mb(h));
|
||||||
} else { /* AV_PICTURE_TYPE_B */
|
} else { /* AV_PICTURE_TYPE_B */
|
||||||
do {
|
do {
|
||||||
@@ -1102,14 +1104,16 @@ static int decode_pic(AVSContext *h)
|
|||||||
if (h->skip_mode_flag && (skip_count < 0))
|
if (h->skip_mode_flag && (skip_count < 0))
|
||||||
skip_count = get_ue_golomb(&h->gb);
|
skip_count = get_ue_golomb(&h->gb);
|
||||||
if (h->skip_mode_flag && skip_count--) {
|
if (h->skip_mode_flag && skip_count--) {
|
||||||
decode_mb_b(h, B_SKIP);
|
ret = decode_mb_b(h, B_SKIP);
|
||||||
} else {
|
} else {
|
||||||
mb_type = get_ue_golomb(&h->gb) + B_SKIP + h->skip_mode_flag;
|
mb_type = get_ue_golomb(&h->gb) + B_SKIP + h->skip_mode_flag;
|
||||||
if (mb_type > B_8X8)
|
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
|
else
|
||||||
decode_mb_b(h, mb_type);
|
ret = decode_mb_b(h, mb_type);
|
||||||
}
|
}
|
||||||
|
if (ret < 0)
|
||||||
|
break;
|
||||||
} while (ff_cavs_next_mb(h));
|
} while (ff_cavs_next_mb(h));
|
||||||
}
|
}
|
||||||
emms_c();
|
emms_c();
|
||||||
|
Reference in New Issue
Block a user