swscale: avoid UB on interlaced frames

NULL+0 is UB.

Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas
2026-02-23 19:39:17 +00:00
committed by Niklas Haas
parent d918551650
commit afdb683a3f
+2 -1
View File
@@ -1336,7 +1336,8 @@ static SwsImg get_frame_img(const AVFrame *frame, int field)
/* Odd rows, offset by one line */
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
for (int i = 0; i < 4; i++) {
img.data[i] += img.linesize[i];
if (img.data[i])
img.data[i] += img.linesize[i];
if (desc->flags & AV_PIX_FMT_FLAG_PAL)
break;
}