Commit 18490ceca0 for ffmpeg
commit 18490ceca0d0b8a1aff0bb05abe82c59ccdbe7ff
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Wed Nov 11 19:18:06 2026 +0100
avfilter/vf_lcevc: allocate the output frame for the picture LCEVCdec outputs
Fixes: out of array write
Fixes: MO1ctCOYehkw
Fixes: vf-lcevc-4x.ts
Out of array write Replicated through UnModified FFmpeg with ASAN
Found-by: betah4k
diff --git a/libavfilter/vf_lcevc.c b/libavfilter/vf_lcevc.c
index 01e5ded900..6fe6edb61f 100644
--- a/libavfilter/vf_lcevc.c
+++ b/libavfilter/vf_lcevc.c
@@ -354,6 +354,18 @@ static int activate(AVFilterContext *ctx)
av_frame_free(&in);
return ret;
}
+
+ LCEVC_PictureDesc desc;
+ if (LCEVC_PeekDecoderPictureDesc(lcevc->decoder, in->pts, &desc) != LCEVC_Success ||
+ desc.colorFormat != map_format(outlink->format)) {
+ av_log(ctx, AV_LOG_ERROR, "Unsupported enhanced picture\n");
+ LCEVC_SkipDecoder(lcevc->decoder, in->pts);
+ LCEVC_SynchronizeDecoder(lcevc->decoder, 0);
+ flush_bases(ctx);
+ return AVERROR_EXTERNAL;
+ }
+ lcevc->w = desc.width;
+ lcevc->h = desc.height;
}
out = ff_get_video_buffer(outlink, lcevc->w, lcevc->h);