Improves speed of the testcase by about a factor of 10 Fixes: Timeout Fixes: 13132/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664190616829952
Unified · Split
| @@ -56,11 +56,13 @@ static int decode_frame(AVCodecContext *avctx, · 55 unmodified lines | ||
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | bytestream2_init(&gb, avpkt->data, avpkt->size); |
| 59 | + blocks = bytestream2_get_le16(&gb); | |
| 60 | + if (!blocks) | |
| 61 | + return avpkt->size; | |
| 59 | 62 | |
| 60 | 63 | if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0) |
| 61 | 64 | return ret; |
| 62 | 65 | |
| 63 | − blocks = bytestream2_get_le16(&gb); | |
| 64 | 66 | if (blocks > 5) { |
| 65 | 67 | GetByteContext bgb; |
| 66 | 68 | int x = 0, size; |