[FFmpeg-cvslog] jpegls: return meaningful errors

Luca Barbato git at videolan.org
Mon Jun 3 00:22:22 CEST 2013


ffmpeg | branch: release/1.1 | Luca Barbato <lu_zero at gentoo.org> | Fri May 17 12:36:06 2013 +0200| [9eecf633f7015cd8364354ffb7846d999519d099] | committer: Reinhard Tartler

jpegls: return meaningful errors

(cherry picked from commit a5a0ef5e13a59ff53318a45d77c5624b23229c6f)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

Conflicts:
	libavcodec/jpeglsdec.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9eecf633f7015cd8364354ffb7846d999519d099
---

 libavcodec/jpeglsdec.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 8a55847..b0badbb 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -70,13 +70,13 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
     case 2:
     case 3:
         av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n");
-        return -1;
+        return AVERROR(ENOSYS);
     case 4:
         av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n");
-        return -1;
+        return AVERROR(ENOSYS);
     default:
         av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
-        return -1;
+        return AVERROR_INVALIDDATA;
     }
     av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
 
@@ -327,11 +327,11 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor
             last = cur;
             cur += s->picture_ptr->linesize[0];
         }
-    } else if(ilv == 2) { /* sample interleaving */
+    } else if (ilv == 2) { /* sample interleaving */
         av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
         av_free(state);
         av_free(zero);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     if(shift){ /* we need to do point transform or normalize samples */



More information about the ffmpeg-cvslog mailing list