Skip to content

Commit

Permalink
avcodec/apedec: tmpk==32 is not supported, prevent undefined behavior
Browse files Browse the repository at this point in the history
Fixes CID1206639
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 26, 2014
1 parent 669a09f commit ebfe154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/apedec.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)
return AVERROR_INVALIDDATA;
}
x = range_decode_bits(ctx, tmpk);
} else if (tmpk <= 32) {
} else if (tmpk <= 31) {
x = range_decode_bits(ctx, 16);
x |= (range_decode_bits(ctx, tmpk - 16) << 16);
} else {
Expand Down

0 comments on commit ebfe154

Please sign in to comment.