Hello,

in attach patch to fix ret code check in webp lossy decoding (when files
have alpha)

before this patch, if an error occured during rgb decoding
the return code was ignored. And a useless ret test was made
after alpha decoding.

after this patch, the return code of rgb is test before
trying to decode alpha.


Comments welcome

Martin
Jokyo Images
From 4b7a1b3c03ec1a9062d3100d79668d905f6226fe Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vign...@gmail.com>
Date: Sun, 26 Jun 2016 22:36:23 +0200
Subject: [PATCH] libavcodec/webp : fix return code check in lossy decoding

before this patch, if an error occured during rgb decoding
the return code was ignored. And an useless ret test was made
after alpha decoding.

after this patch, the return code of rgb is test before
trying to decode alpha.
---
 libavcodec/webp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index e715c4b..b119d8a 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -1342,10 +1342,10 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
 
     ret = ff_vp8_decode_frame(avctx, p, got_frame, &pkt);
     if (s->has_alpha) {
-        ret = vp8_lossy_decode_alpha(avctx, p, s->alpha_data,
-                                     s->alpha_data_size);
         if (ret < 0)
             return ret;
+        ret = vp8_lossy_decode_alpha(avctx, p, s->alpha_data,
+                                     s->alpha_data_size);
     }
     return ret;
 }
-- 
1.9.3 (Apple Git-50)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to