jpegdec: don't overwrite the last valid line
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 7 Nov 2018 08:00:02 +0000 (09:00 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 10 Nov 2019 12:50:19 +0000 (12:50 +0000)
commit54c1aa8db647bda90b4794a51e3510d02b338bc0
treeede6a8cbb87abf489b3768b719c7540dea80d606
parent061ea44185f7f5555af412f2875542e57829fd81
jpegdec: don't overwrite the last valid line

If the the height is not a multiple of the macro block size then the memory
of the last line is reused for all extra lines. This is no problem if the
last line is duplicated properly. However, if the extra lines are not
initialized properly during encoding, then the last visible line is
overwritten with undefined data.
Use a extra buffer to avoid this problem.
ext/jpeg/gstjpegdec.c
ext/jpeg/gstjpegdec.h