[FFmpeg-devel] yuv420p_to_rgb24 core dump

Stevens, Andrew J PNNL Andrew.Stevens
Fri Sep 17 21:23:36 CEST 2010


Hi,

On Fri, Sep 17, 2010 at 1:33 PM, Stevens, Andrew J (PNNL)
<Andrew.Stevens at pnl.gov> wrote:
> I'm writing some video analysis software and I need each frame converted to RGB24 in memory.
> I encountered a core dump when trying to use a .mov as input.
> I tried to reproduce it from the command line, but that worked fine.
>
> Command line attempt:
> $ ffmpeg -i questionable.mov -pix_fmt rgb24 abc%08d.ppm
> FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
> ?built on Sep 17 2010 09:26:42 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
> ...
> Seems stream 0 codec frame rate differs from container frame rate: 100000.00 (100000/1) -> 15.00 (50000/3333)
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'questionable.mov':
> ?Metadata:
> ? ?major_brand ? ? : qt
> ? ?minor_version ? : 0
> ? ?compatible_brands: qt
> ?Duration: 00:00:19.33, start: 0.-733260, bitrate: 1236 kb/s
> ? ?Stream #0.0(und): Video: h264, yuv420p, 1280x800 [PAR 1:1 DAR 8:5], 1231 kb/s, 12.42 fps, 15 tbr, 50k tbn, 100k tbc
> Output #0, image2, to 'abc%08d.ppm':
> ?Metadata:
> ? ?encoder ? ? ? ? : Lavf52.64.2
> ? ?Stream #0.0(und): Video: ppm, rgb24, 1280x800 [PAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 90k tbn, 15 tbc
> ...
>
> Code:
> SwsContext *img_convert_ctx = ?sws_getContext(width,height, codecContext->pix_fmt, width, height, PIX_FMT_RGB24 , SWS_BICUBIC, NULL, NULL, NULL);
> sws_scale(img_convert_ctx, rawFrame->data, rawFrame->linesize, 0, height, scaledFrame->data, scaledFrame->linesize);
>
>
> Backtrace:
> ?(gdb) r
> Starting program: foo
> [Thread debugging using libthread_db enabled]
> Probed with size=2048 and score=100
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1180630]ISO: File Type Major Brand: qt
> [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1180630]All info found
> [h264 @ 0x1181a80]no picture
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000899cc8 in yuv420_rgb24_MMX2 (c=0x1994c80, src=0x7fffffffd5a0, srcStride=0x7fffffffd570, srcSliceY=0, srcSliceH=800,
> ? ?dst=0x7fffffffd580, dstStride=0x7fffffffd560) at libswscale/x86/yuv2rgb_template2.c:327
> 327 ? ? ? ? ? ? YUV2RGB_INITIAL_LOAD
> (gdb) bt
> #0 ?0x0000000000899cc8 in yuv420_rgb24_MMX2 (c=0x1994c80, src=0x7fffffffd5a0, srcStride=0x7fffffffd570, srcSliceY=0, srcSliceH=800,
> ? ?dst=0x7fffffffd580, dstStride=0x7fffffffd560) at libswscale/x86/yuv2rgb_template2.c:327
> #1 ?0x0000000000878ae7 in sws_scale (c=0x1994c80, src=0x11820c0, srcStride=0x11820e0, srcSliceY=0, srcSliceH=800, dst=0x11882f0,
> ? ?dstStride=0x1188310) at libswscale/swscale.c:1931

Could you provide the output of disass $pc-30 $pc+30?

Thanks,
Ronald

(gdb) disass $pc-30 $pc+30
Dump of assembler code from 0x899efa to 0x899f36:
0x0000000000899efa <yuv420_rgb24_MMX2+365>:     add    %rax,%rax
0x0000000000899efd <yuv420_rgb24_MMX2+368>:     mov    %rax,%rdx
0x0000000000899f00 <yuv420_rgb24_MMX2+371>:     mov    -0x28(%rbp),%rax
0x0000000000899f04 <yuv420_rgb24_MMX2+375>:     mov    %rax,%rcx
0x0000000000899f07 <yuv420_rgb24_MMX2+378>:     sub    %rdx,%rcx
0x0000000000899f0a <yuv420_rgb24_MMX2+381>:     mov    -0x10(%rbp),%rdx
0x0000000000899f0e <yuv420_rgb24_MMX2+385>:     mov    -0x30(%rbp),%rax
0x0000000000899f12 <yuv420_rgb24_MMX2+389>:     mov    %rdx,%rbx
0x0000000000899f15 <yuv420_rgb24_MMX2+392>:     mov    %rax,%r9
0x0000000000899f18 <yuv420_rgb24_MMX2+395>:     movq   (%rcx,%rbx,2),%mm6
0x0000000000899f1c <yuv420_rgb24_MMX2+399>:     movd   (%r8,%rbx,1),%mm0
0x0000000000899f21 <yuv420_rgb24_MMX2+404>:     movd   (%rsi,%rbx,1),%mm1
0x0000000000899f25 <yuv420_rgb24_MMX2+408>:     movq   %mm6,%mm7
0x0000000000899f28 <yuv420_rgb24_MMX2+411>:     punpcklbw %mm4,%mm0
0x0000000000899f2b <yuv420_rgb24_MMX2+414>:     punpcklbw %mm4,%mm1
0x0000000000899f2e <yuv420_rgb24_MMX2+417>:     pand   0x9d2b88,%mm6
End of assembler dump.

I recompiled ffmpeg with mmx2 disabled and again with mmx and mmx2 disabled. Both gave core dumps.

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list