avcodec/apedec: tmpk==32 is not supported, prevent undefined behavior
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Apr 2014 18:56:31 +0000 (20:56 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 26 Apr 2014 18:56:31 +0000 (20:56 +0200)
Fixes CID1206639
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/apedec.c

index 7e1c6bb..1fd41cd 100644 (file)
@@ -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 {