mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-05-09 12:32:56 +02:00
3144652588
sub_median_pred_mmxext() calculates a predictor from the left, top and topleft pixel values. The topleft values need to be initialized differently for the first loop initialization than for the others in order to avoid reading ptr[-1]. So it has been initialized before the loop and then read again at the end of the loop, so that the last value read was never used. Yet this can lead to reads beyond the end of the buffer, e.g. with ffmpeg -cpuflags mmx+mmxext -f lavfi -i "color=size=64x4,format=yuv420p" \ -vf vflip -c:v ffvhuff -pred median -frames 1 -f null - Fix this by not reading the value at the end of the loop. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>