summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2014-07-11 12:19:43 -0300
committerJacek Anaszewski <j.anaszewski@samsung.com>2014-11-05 16:05:27 +0100
commitf5c053aaca0cdc156297ac3971bb41fcb57c0217 (patch)
tree7b32954cd9466bfc551305bff4aab11467145a90
parentb1a9753b0f605794da906c303f11616db4a07bc5 (diff)
downloadlinux-3.10-f5c053aaca0cdc156297ac3971bb41fcb57c0217.tar.gz
linux-3.10-f5c053aaca0cdc156297ac3971bb41fcb57c0217.tar.bz2
linux-3.10-f5c053aaca0cdc156297ac3971bb41fcb57c0217.zip
[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. Change-Id: I82429c1e2878f27276594da1069b30c40b83aadb 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>
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c4
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 126199e010c..a3f8862e60f 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;