Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a35f6003 authored by Jacek Anaszewski's avatar Jacek Anaszewski Committed by Mauro Carvalho Chehab
Browse files

[media] s5p-jpeg: return error immediately after get_byte fails



When parsing JPEG header s5p_jpeg_parse_hdr function
should return immediately in case there was an error
while reading a byte.

Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 3246fdaa
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -906,14 +906,14 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,
	while (notfound) {
	while (notfound) {
		c = get_byte(&jpeg_buffer);
		c = get_byte(&jpeg_buffer);
		if (c == -1)
		if (c == -1)
			break;
			return false;
		if (c != 0xff)
		if (c != 0xff)
			continue;
			continue;
		do
		do
			c = get_byte(&jpeg_buffer);
			c = get_byte(&jpeg_buffer);
		while (c == 0xff);
		while (c == 0xff);
		if (c == -1)
		if (c == -1)
			break;
			return false;
		if (c == 0)
		if (c == 0)
			continue;
			continue;
		length = 0;
		length = 0;