[FFmpeg-devel] mjpeg and llvm-gcc

Colin McQuillan m.niloc
Thu Jun 18 01:25:45 CEST 2009


2009/6/17 Derk-Jan Hartman <hartman at videolan.org>
>
> For VLC media player Mac OS X, we were working on using llvm-gcc for the new binaries. VLC and FFmpeg was behaving very well with it, but recently I noticed it crashed in ff_mjpeg_decode_sos() for almost all MJPEGs.
>
> Example file: http://samples.mplayerhq.hu/V-codecs/MJPEGs/angels_480-mjpegcompress.avi
>
> This file (and other mjpeg files) was producing "error dc" errors, and eventually crashed.
> I have been able to determine that when I switch from llvm-gcc-4.2 back to gcc-4.2, the crash disappeared. I have little experience trying to track causes to things like this, so if anyone has any tips on how to proceed, I would welcome them. If someone could try with llvm on Linux, that might be useful as well. I guess this might possibly be a compiler bug ? Should I try different optimization settings ?
>
>

On Ubuntu I get the "error dc" messages but no crash. Also the picture
is squashed to 1/8 the normal height. I get a normal picture and no
errors using the following change:

--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -888,6 +888,7 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s)
     int index, id;
     const int block_size= s->lossless ? 1 : 8;
     int ilv, prev_shift;
+    av_log(s->avctx, AV_LOG_DEBUG, "decode_sos: lossless=%d\n", s->lossless);

     /* XXX: verify len field validity */
     len = get_bits(&s->gb, 16);


Version:

FFplay version git-5ffd35b, Copyright (c) 2003-2009 Fabrice Bellard, et al.
  configuration: --cc=llvm-gcc --disable-mmx
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.31. 2 / 52.31. 2
  libavformat   52.34. 0 / 52.34. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  built on Jun 17 2009 22:59:00, gcc: 4.2.1 (Based on Apple Inc. build
5546) (LLVM build)



More information about the ffmpeg-devel mailing list