avcodec/lcldec: 420 seems missing 2 bytes, ignore that

Fixes: Ticket 10238
Fixes: mszh_306_306_yuv420.avi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-03-09 13:57:16 +01:00
parent 0cf1ac905d
commit 4ea28554db
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 3 additions and 1 deletions

View File

@ -219,7 +219,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (c->decomp_size != mszh_dlen) {
av_log(avctx, AV_LOG_ERROR, "Decoded size differs (%d != %d)\n",
c->decomp_size, mszh_dlen);
return AVERROR_INVALIDDATA;
if (c->decomp_size != mszh_dlen &&
c->decomp_size != mszh_dlen + 2) // YUV420 306x306 is missing 2 bytes
return AVERROR_INVALIDDATA;
}
encoded = c->decomp_buf;
len = mszh_dlen;