LF-1571: mxc-jpeg: Fix decoding invalid buffer
authorMirela Rabulea <mirela.rabulea@oss.nxp.com>
Wed, 27 Jan 2021 18:27:47 +0000 (20:27 +0200)
committerMirela Rabulea <mirela.rabulea@oss.nxp.com>
Sat, 30 Jan 2021 15:24:16 +0000 (17:24 +0200)
commit98d1e0561db18e105059adbf0a4f6c19bb452f19
treea454d486fdaefdd2c208f70e8cef35d4a82ca996
parente3969a5f47a584eaca5c003e79962150ba5be1b0
LF-1571: mxc-jpeg: Fix decoding invalid buffer

End of buffer was not properly detected in case of an invalid
buffer stream, such as a stream of null bytes, for example.
This was leading to a kernel oups.
Let get_byte return type be int, so it can return an error for
reaching end of stream.

While at it, replace 0 with NULL, for null pointer initialization.

Fixes: 36649dec0eb7 ("mxc-jpeg: Fix result independent of operands")
Signed-off-by: Mirela Rabulea <mirela.rabulea@oss.nxp.com>
drivers/media/platform/imx8/mxc-jpeg.c