[SCM] libav/experimental: mjpegdec: check that the coded dc_index and ac_index have a valid associated VLC table. Removes some disabled dc_index/ac_index checking code that seems to have had some undocumented issues and should not really be necessary anymore now. Fixes from issue 1240 the files mjpeg/smclockmjpeg.avi.1.10 and mjpeg/smclockmjpeg.avi.1.171.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:48:33 UTC 2013


The following commit has been merged in the experimental branch:
commit b27bf2a7b4fd57c36eccb11f5af794d4b940cfdc
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Sat Jul 4 12:54:36 2009 +0000

    mjpegdec: check that the coded dc_index and ac_index have a valid associated VLC table.
    Removes some disabled dc_index/ac_index checking code that seems to have had
    some undocumented issues and should not really be necessary anymore now.
    Fixes from issue 1240 the files mjpeg/smclockmjpeg.avi.1.10 and mjpeg/smclockmjpeg.avi.1.171.
    
    Originally committed as revision 19341 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index d468133..90b87f4 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -922,24 +922,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s)
         if (s->dc_index[i] <  0 || s->ac_index[i] < 0 ||
             s->dc_index[i] >= 4 || s->ac_index[i] >= 4)
             goto out_of_range;
-#if 0 //buggy
-        switch(s->start_code)
-        {
-            case SOF0:
-                if (dc_index[i] > 1 || ac_index[i] > 1)
-                    goto out_of_range;
-                break;
-            case SOF1:
-            case SOF2:
-                if (dc_index[i] > 3 || ac_index[i] > 3)
-                    goto out_of_range;
-                break;
-            case SOF3:
-                if (dc_index[i] > 3 || ac_index[i] != 0)
-                    goto out_of_range;
-                break;
-        }
-#endif
+        if (!s->vlcs[0][s->dc_index[i]].table || !s->vlcs[1][s->ac_index[i]].table)
+            goto out_of_range;
     }
 
     predictor= get_bits(&s->gb, 8); /* JPEG Ss / lossless JPEG predictor /JPEG-LS NEAR */

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list