]> git.sesse.net Git - ffmpeg/commitdiff
Fix undefined behavior in ffv1 with insane widths.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Apr 2011 10:46:36 +0000 (12:46 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Apr 2011 10:49:52 +0000 (12:49 +0200)
The new tables is large enough to prevent this together with our image size checks.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/bitstream.c
libavcodec/ffv1.c

index 83f30f97990cb8d26136413e7427ee48ae0a2c09..8fd44e3d786f3274588987fba8453c67ae0059b5 100644 (file)
 #include "get_bits.h"
 #include "put_bits.h"
 
-const uint8_t ff_log2_run[32]={
+const uint8_t ff_log2_run[41]={
  0, 0, 0, 0, 1, 1, 1, 1,
  2, 2, 2, 2, 3, 3, 3, 3,
  4, 4, 5, 5, 6, 6, 7, 7,
- 8, 9,10,11,12,13,14,15
+ 8, 9,10,11,12,13,14,15,
+16,17,18,19,20,21,22,23,
+24,
 };
 
 void align_put_bits(PutBitContext *s)
index 7d1492ff46b5e0e1cdd6c929b2c3fdc6b7ba32b4..b00b463e16e32317795e768f0522014453016a21 100644 (file)
@@ -40,7 +40,7 @@
 #define MAX_QUANT_TABLES 8
 #define MAX_CONTEXT_INPUTS 5
 
-extern const uint8_t ff_log2_run[32];
+extern const uint8_t ff_log2_run[41];
 
 static const int8_t quant3[256]={
  0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,