History

avcodec/wcmv: Avoid copying frames if they are unchanged

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

Michael Niedermayer committed 7 years ago

Commit 976dae81 parent 286a33e1 file · +3 −1Browse files

Unified · Split

libavcodec/wcmv.c+3−1
@@ -56,11 +56,13 @@ static int decode_frame(AVCodecContext *avctx, · 55 unmodified lines
5656 }
5757
5858 bytestream2_init(&gb, avpkt->data, avpkt->size);
59+ blocks = bytestream2_get_le16(&gb);
60+ if (!blocks)
61+ return avpkt->size;
5962
6063 if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
6164 return ret;
6265
63− blocks = bytestream2_get_le16(&gb);
6466 if (blocks > 5) {
6567 GetByteContext bgb;
6668 int x = 0, size;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t