Michael Niedermayer
1957095e80
avformat/swfdec: Check outlen before allocation
...
Fixes: Timeout (too long -> 241ms)
Fixes: 29083/clusterfuzz-testcase-minimized-ffmpeg_dem_SWF_fuzzer-6273684478230528
The source of the magic number is
A very quick simulation of the best case compression for "compress"
below is not nice written code as i did not expect I or anyone else
would ever see it again
I would have preferred some nicer expression or course, but thats
what it seems to be asymptotically. For smaller amounts of data a
tighter bound is possible but i saw no nice way to consider that
and it seems also overkill to try to do it more fine grained for
just this
main(){
int64_t bits = 0;
int bank = 256;
int bitbank = 8;
for(unsigned i = 0; i<1024*1024*1024*4U-100000;) {
int word_size = bank-255;
i += word_size;
bits += bitbank;
if (!(bank & (bank-1)))
bitbank ++;
bank++;
if (bitbank > 16) {
printf("BEST %f \n", 8.0 * i / bits );
bank = 256;
bitbank = 8;
}
}
}
above assumes i remembered correctly how the algorithm works but the
value was close to what actual compession of zeros gave
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-03-08 22:08:49 +01:00
..
2021-02-09 19:37:27 +01:00
2021-02-04 23:34:29 +01:00
2021-03-05 09:16:00 +01:00
2021-01-11 23:15:04 +01:00
2021-01-23 14:32:54 +01:00
2021-02-23 11:30:57 +01:00
2021-02-23 11:30:57 +01:00
2021-03-03 16:54:20 +01:00
2021-02-23 11:30:57 +01:00
2021-03-05 19:45:00 +02:00
2021-02-24 08:17:50 +01:00
2021-02-24 08:17:50 +01:00
2021-02-24 08:17:50 +01:00
2021-01-29 19:36:46 +01:00
2021-02-23 10:14:26 +01:00
2021-02-23 11:30:57 +01:00
2021-02-23 11:30:57 +01:00
2021-02-23 11:30:57 +01:00
2021-02-23 11:30:57 +01:00
2021-02-02 23:53:29 +01:00
2021-02-23 10:14:26 +01:00
2020-12-06 21:00:03 +01:00
2021-03-03 14:41:08 +01:00
2021-02-25 11:46:28 +01:00
2021-02-23 11:30:57 +01:00
2021-02-28 17:14:21 +01:00
2021-02-25 22:05:09 +01:00
2021-02-25 22:05:09 +01:00
2021-01-23 14:32:54 +01:00
2021-02-04 17:52:45 +01:00
2021-02-23 10:14:26 +01:00
2021-02-23 10:14:26 +01:00
2021-02-23 10:14:26 +01:00
2021-02-23 10:14:26 +01:00
2021-02-05 18:11:42 +01:00
2021-01-20 01:02:56 -06:00
2021-02-27 04:27:09 +01:00
2021-03-08 02:25:52 +01:00
2021-03-03 16:54:20 +01:00
2021-01-21 20:21:32 +01:00
2020-12-06 21:00:03 +01:00
2021-02-03 10:41:33 +01:00
2020-12-06 18:09:24 +01:00
2021-02-03 21:35:43 +01:00
2021-02-12 23:42:16 +01:00
2021-01-23 01:05:25 +01:00
2021-02-10 00:03:38 +01:00
2021-02-10 21:18:16 +01:00
2020-12-08 18:54:20 +01:00
2021-03-03 16:46:09 +01:00
2021-01-08 05:06:11 +01:00
2021-01-24 10:55:29 +08:00
2021-02-02 20:55:50 +08:00
2020-12-28 11:09:19 +08:00
2021-03-07 00:39:32 +01:00
2021-02-10 12:28:29 +01:00
2021-01-23 14:32:54 +01:00
2021-02-15 00:34:01 +01:00
2021-02-18 13:00:40 +01:00
2021-02-25 23:10:14 +01:00
2021-02-13 13:05:26 -03:00
2021-02-16 23:45:01 +01:00
2021-02-25 11:46:28 +01:00
2021-02-23 10:14:26 +01:00
2021-03-03 07:22:02 -05:00
2020-12-21 01:27:33 -05:00
2021-02-07 19:42:22 +01:00
2021-03-03 16:54:20 +01:00
2021-03-05 19:45:00 +02:00
2021-03-02 06:54:47 +01:00
2021-03-02 06:54:47 +01:00
2021-03-02 07:04:11 +01:00
2021-03-03 16:54:20 +01:00
2021-02-21 22:50:52 +01:00
2021-03-08 19:19:19 +01:00
2021-03-08 19:19:19 +01:00
2021-03-01 20:19:15 +01:00
2021-03-01 06:10:44 +01:00
2021-02-27 22:09:51 +01:00
2021-01-28 21:06:48 +01:00
2021-02-19 07:45:48 +01:00
2021-01-09 22:38:12 +01:00
2021-01-26 18:37:12 +01:00
2021-03-03 16:54:20 +01:00
2021-02-13 13:05:26 -03:00
2021-02-10 12:28:29 +01:00
2021-01-26 18:37:12 +01:00
2021-02-01 23:52:55 +01:00
2021-02-01 23:52:55 +01:00
2021-03-04 20:23:51 +01:00
2021-02-16 22:51:11 +01:00
2021-01-21 20:21:32 +01:00
2021-02-14 19:55:02 +01:00
2021-01-28 21:08:11 +01:00
2021-02-23 11:26:21 +01:00
2021-02-23 11:26:21 +01:00
2021-02-23 11:26:21 +01:00
2021-02-23 11:24:00 +01:00
2021-01-21 20:21:32 +01:00
2021-02-28 17:14:21 +01:00
2021-02-28 17:14:21 +01:00
2021-02-03 22:28:11 +01:00
2021-02-03 22:28:11 +01:00
2021-02-12 23:42:16 +01:00
2020-12-11 00:23:41 +01:00
2021-01-24 11:28:53 +01:00
2021-01-26 18:37:12 +01:00
2021-02-23 11:30:57 +01:00
2021-02-23 11:30:57 +01:00
2021-02-16 19:02:24 +01:00
2020-12-09 21:41:15 +01:00
2021-01-11 23:15:04 +01:00
2021-02-23 11:24:00 +01:00
2021-02-23 11:24:00 +01:00
2021-02-23 11:24:00 +01:00
2021-02-23 11:24:00 +01:00
2021-02-02 23:53:29 +01:00
2021-02-02 23:53:29 +01:00
2021-02-02 23:53:29 +01:00
2021-01-24 11:28:53 +01:00
2021-01-31 21:26:44 +01:00
2021-01-24 11:19:10 +01:00
2021-02-03 21:36:47 +01:00
2020-12-28 14:08:44 -08:00
2020-12-28 14:08:44 -08:00
2020-12-05 09:00:53 +08:00
2021-02-10 12:28:30 +01:00
2021-02-01 19:03:53 +01:00
2021-02-02 13:12:12 +01:00
2021-03-04 22:22:36 +01:00
2021-02-02 13:12:12 +01:00
2021-02-02 13:12:12 +01:00
2021-02-27 04:27:09 +01:00
2021-01-23 20:10:05 +01:00
2021-03-08 22:08:49 +01:00
2021-01-23 20:10:05 +01:00
2021-01-29 19:36:46 +01:00
2020-12-07 13:34:06 +02:00
2021-01-20 01:02:56 -06:00
2021-02-02 13:12:12 +01:00
2021-03-05 19:45:00 +02:00
2021-01-16 08:51:31 +08:00
2020-12-16 22:45:28 +01:00
2021-02-02 23:53:29 +01:00
2021-03-03 14:41:08 +01:00
2021-03-05 19:45:00 +02:00
2021-01-05 02:00:05 +01:00
2021-03-01 20:19:15 +01:00
2021-02-23 21:12:26 +01:00
2021-02-23 11:23:29 +01:00
2021-02-23 11:23:29 +01:00
2021-02-23 11:23:29 +01:00
2021-02-24 17:04:40 +01:00
2020-12-05 00:08:33 +01:00
2021-02-23 11:30:57 +01:00
2021-02-27 04:27:09 +01:00
2021-02-28 17:14:22 +01:00
2021-02-09 19:37:27 +01:00
2021-02-23 11:30:57 +01:00