[FFmpeg-devel] ffmpeg crash when converting frames to RGB images

Pierre CHIQUET pchiquet
Tue Apr 15 13:08:07 CEST 2008


Hi all,

FFmpeg crash immediately with some videos (a sample file is attached)
when I try to convert the video frames to RGB images.
I'm using the latest svn version (12829).


- When I extract jpeg from this video, it works fine (the destination
pixel format for swscale is PIX_FMT_YUVJ420P):

$ ffmpeg -i swscale_YUV_to_RGB_crash.flv %d.jpg
FFmpeg version SVN-r12829, Copyright (c) 2000-2008 Fabrice Bellard, et al.
   configuration: --enable-postproc --enable-shared --enable-gpl
--disable-ffserver --disable-ffplay --enable-swscale --enable-libx264
--enable-libxvid
   libavutil version: 49.6.0
   libavcodec version: 51.54.0
   libavformat version: 52.13.0
   libavdevice version: 52.0.0
   built on Apr 15 2008 12:24:13, gcc: 4.0.2 20051125 (Red Hat 4.0.2-8)

Seems stream 0 codec frame rate differs from container frame rate:
1000.00 (1000/1) -> 59.94 (60000/1001)
Input #0, flv, from
'/users/pchiquet/error_videos/1/swscale_YUV_to_RGB_crash.flv':
   Duration: 00:00:01.0, start: 0.000000, bitrate: N/A
     Stream #0.0: Video: flv, yuv420p, 260x195, 59.94 tb(r)
     Stream #0.1: Audio: adpcm_swf, 22050 Hz, mono
Output #0, image2, to '%d.jpg':
     Stream #0.0: Video: mjpeg, yuvj420p, 260x195, q=2-31, 200 kb/s,
59.94 tb(c)
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
frame=   62 fps=  0 q=24.8 Lsize=      -0kB time=1.0 bitrate=  -0.2kbits/s
video:207kB audio:0kB global headers:0kB muxing overhead -100.010375%


- With the same video, if the frames are converted to RGB images, ffmpeg 
crash (the same command works with other videos):

$ ffmpeg -i swscale_YUV_to_RGB_crash.flv %d.ppm
FFmpeg version SVN-r12829, Copyright (c) 2000-2008 Fabrice Bellard, et al.
   configuration: --enable-postproc --enable-shared --enable-gpl
--disable-ffserver --disable-ffplay --enable-swscale --enable-libx264
--enable-libxvid
   libavutil version: 49.6.0
   libavcodec version: 51.54.0
   libavformat version: 52.13.0
   libavdevice version: 52.0.0
   built on Apr 15 2008 12:24:13, gcc: 4.0.2 20051125 (Red Hat 4.0.2-8)

Seems stream 0 codec frame rate differs from container frame rate:
1000.00 (1000/1) -> 59.94 (60000/1001)
Input #0, flv, from 'swscale_YUV_to_RGB_crash.flv':
   Duration: 00:00:01.0, start: 0.000000, bitrate: N/A
     Stream #0.0: Video: flv, yuv420p, 260x195, 59.94 tb(r)
     Stream #0.1: Audio: adpcm_swf, 22050 Hz, mono
[swscaler @ 0x139a98]No accelerated colorspace conversion found
Output #0, image2, to '%d.ppm':
     Stream #0.0: Video: ppm, rgb24, 260x195, q=2-31, 200 kb/s, 59.94 tb(c)
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
Segmentation fault


- valgrind returns many invalid write errors:
$ valgrind ffmpeg -i swscale_YUV_to_RGB_crash.flv %d.ppm
...
==28378== Invalid write of size 1
==28378==    at 0x1B9322B3: yuv2rgb_c_24_rgb (yuv2rgb.c:320)
==28378==  Address 0x1C137984 is 0 bytes after a block of size 152100
alloc'd
==28378==    at 0x1B909D2F: memalign (vg_replace_malloc.c:216)
==28378==    by 0x1BE5E25E: av_malloc (mem.c:61)
==28378==    by 0x504D7E: __libc_start_main (in /lib/libc-2.3.6.so)
==28378==    by 0x804AC5C: (within
/cvs/devContribs/ffmpeg/linux/svn-12829/ffmpeg)
==28378==
...

Thanks for your help!

-- 
Pierre CHIQUET


-------------- next part --------------
A non-text attachment was scrubbed...
Name: swscale_YUV_to_RGB_crash.flv
Type: application/octet-stream
Size: 100082 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080415/79f12f71/attachment.obj>



More information about the ffmpeg-devel mailing list