[FFmpeg-soc] [soc]: r4247 - jpeg2000/j2kdec.c

michael subversion at mplayerhq.hu
Wed Apr 29 02:10:07 CEST 2009


Author: michael
Date: Wed Apr 29 02:10:06 2009
New Revision: 4247

Log:
Be less picky on missing and extraneous data.

Modified:
   jpeg2000/j2kdec.c

Modified: jpeg2000/j2kdec.c
==============================================================================
--- jpeg2000/j2kdec.c	Tue Apr 28 21:26:05 2009	(r4246)
+++ jpeg2000/j2kdec.c	Wed Apr 29 02:10:06 2009	(r4247)
@@ -833,9 +833,10 @@ static int decode_codestream(J2kDecoderC
     for (;;){
         int marker, len, ret = 0;
         uint8_t *oldbuf;
-
-        if (s->buf_end - s->buf < 2)
-            return AVERROR(EINVAL);
+        if (s->buf_end - s->buf < 2){
+            av_log(s->avctx, AV_LOG_ERROR, "Missing EOC\n");
+            break;
+        }
 
         marker = bytestream_get_be16(&s->buf);
         oldbuf = s->buf;
@@ -877,7 +878,7 @@ static int decode_codestream(J2kDecoderC
                 s->buf += len - 2; break;
             default:
                 av_log(s->avctx, AV_LOG_ERROR, "unsupported marker 0x%.4X at pos 0x%x\n", marker, s->buf - s->buf_start - 4);
-                return -1;
+                s->buf += len - 2; break;
         }
         if (s->buf - oldbuf != len || ret){
             av_log(s->avctx, AV_LOG_ERROR, "error during processing marker segment %.4x\n", marker);


More information about the FFmpeg-soc mailing list