mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/nuv: Move comptype check up
Fixes: Timeout (23sec -> 5ms) Fixes: 18517/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-5753135536013312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1138cdecbe0164ab1f07768418e794fddfdc636d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
763427d44b
commit
705a4bb98a
@ -217,6 +217,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
case NUV_RTJPEG:
|
case NUV_RTJPEG:
|
||||||
minsize = c->width/16 * (c->height/16) * 6;
|
minsize = c->width/16 * (c->height/16) * 6;
|
||||||
break;
|
break;
|
||||||
|
case NUV_BLACK:
|
||||||
|
case NUV_COPY_LAST:
|
||||||
|
case NUV_LZO:
|
||||||
|
case NUV_RTJPEG_IN_LZO:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
if (buf_size < minsize / 4)
|
if (buf_size < minsize / 4)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
@ -305,9 +313,6 @@ retry:
|
|||||||
case NUV_COPY_LAST:
|
case NUV_COPY_LAST:
|
||||||
/* nothing more to do here */
|
/* nothing more to do here */
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "unknown compression\n");
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result = av_frame_ref(picture, c->pic)) < 0)
|
if ((result = av_frame_ref(picture, c->pic)) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user