diff options
author | Jacek Anaszewski <j.anaszewski@samsung.com> | 2014-07-11 12:19:43 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-30 19:16:03 -0300 |
commit | a35f60031976d8b9930a2d32ebfdecd82d538066 (patch) | |
tree | 6bc8edb0fe0eb9a64829bb06cb9e64244e1952a2 /drivers/media/platform/s5p-jpeg | |
parent | 3246fdaa0ac2d936b1838589b76fd5aaff02e46d (diff) |
[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: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/s5p-jpeg')
-rw-r--r-- | drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 126199e010c7..a3f8862e60f0 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -906,14 +906,14 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, while (notfound) { c = get_byte(&jpeg_buffer); if (c == -1) - break; + return false; if (c != 0xff) continue; do c = get_byte(&jpeg_buffer); while (c == 0xff); if (c == -1) - break; + return false; if (c == 0) continue; length = 0; |