mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-11 08:13:06 +00:00
avformat/yuv4mpegen: Sanity check input packet frame dimensions
Fixes: out of array access if a filter-graph is used the injects changing dimensions Found-by: Zhenpeng (Leo) Lin from depthfirst Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -197,6 +197,9 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
|
||||
width = st->codecpar->width;
|
||||
height = st->codecpar->height;
|
||||
if (frame->width != width || frame->height != height)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
desc = av_pix_fmt_desc_get(st->codecpar->format);
|
||||
|
||||
/* The following code presumes all planes to be non-interleaved. */
|
||||
|
||||
Reference in New Issue
Block a user