Commit 9f06c1c6 authored by Michael Niedermayer's avatar Michael Niedermayer

cavsdec: avoid possible crash with crafted input

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a9aa88df
......@@ -164,7 +164,7 @@ static inline int decode_residual_inter(AVSContext *h) {
/* get coded block pattern */
int cbp= get_ue_golomb(&h->s.gb);
if(cbp > 63){
if(cbp > 63U){
av_log(h->s.avctx, AV_LOG_ERROR, "illegal inter cbp\n");
return -1;
}
......@@ -223,7 +223,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
/* get coded block pattern */
if(h->pic_type == AV_PICTURE_TYPE_I)
cbp_code = get_ue_golomb(gb);
if(cbp_code > 63){
if(cbp_code > 63U){
av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment