1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/cri: Factor read_len out

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-08-03 14:34:25 +02:00
committed by michaelni
parent 610d368d9b
commit d9bf3c141b

View File

@ -218,10 +218,11 @@ static int cri_decode_frame(AVCodecContext *avctx, AVFrame *p,
if (bytestream2_get_le32(gb) != 0) if (bytestream2_get_le32(gb) != 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
break; break;
case 102: case 102:;
bytestream2_get_buffer(gb, codec_name, FFMIN(length, sizeof(codec_name) - 1)); int read_len = FFMIN(length, sizeof(codec_name) - 1);
length -= FFMIN(length, sizeof(codec_name) - 1); bytestream2_get_buffer(gb, codec_name, read_len))
if (strncmp(codec_name, "cintel_craw", FFMIN(length, sizeof(codec_name) - 1))) length -= read_len;
if (strncmp(codec_name, "cintel_craw", read_len))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
compressed = 1; compressed = 1;
goto skip; goto skip;