Segfault when decoding corrupt .gxf file ./ffmpeg_g -i pedestrians-bug001-minimal.gxf FFmpeg version SVN-r12579, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-gpl --enable-pthreads --prefix=/home/pissaris/local --enable-libx264 --extra-cflags=-I/home/pissaris/local/include --extra-ldflags=-L/home/pissaris/local /lib libavutil version: 49.7.0 libavcodec version: 51.57.2 libavformat version: 52.16.0 libavdevice version: 52.0.0 built on Jun 10 2008 16:58:20, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) [mpeg2video @ 0x850b40]skipped MB in I frame at 14 2 [mpeg2video @ 0x850b40]skipped MB in I frame at 6 3 [mpeg2video @ 0x850b40]invalid mb type in I Frame at 1 4 [mpeg2video @ 0x850b40]skipped MB in I frame at 4 5 [mpeg2video @ 0x850b40]ac-tex damaged at 3 6 [mpeg2video @ 0x850b40]invalid mb type in I Frame at 6 7 [mpeg2video @ 0x850b40]invalid mb type in I Frame at 4 8 [mpeg2video @ 0x850b40]ac-tex damaged at 0 9 [mpeg2video @ 0x850b40]skipped MB in I frame at 5 10 [mpeg2video @ 0x850b40]invalid mb type in I Frame at 5 11 [mpeg2video @ 0x850b40]skipped MB in I frame at 2 12 [mpeg2video @ 0x850b40]ac-tex damaged at 0 13 [mpeg2video @ 0x850b40]skipped MB in I frame at 1 14 [mpeg2video @ 0x850b40]slice mismatch [mpeg2video @ 0x850b40]skipped MB in I frame at 6 16 [mpeg2video @ 0x850b40]qscale == 0 [mpeg2video @ 0x850b40]Warning MVs not available ... [mpeg2video @ 0x850b40]invalid mb type in P Frame at 12 3 [mpeg2video @ 0x850b40]ac-tex damaged at 14 4 [mpeg2video @ 0x850b40]ac-tex damaged at 15 5 [mpeg2video @ 0x850b40]ac-tex damaged at 12 2 [mpeg2video @ 0x850b40]ac-tex damaged at 15 10 [mpeg2video @ 0x850b40]ac-tex damaged at 0 1 [mpeg2video @ 0x850b40]invalid cbp at 4 2 [mpeg2video @ 0x850b40]invalid cbp at 13 3 [mpeg2video @ 0x850b40]slice mismatch [mpeg2video @ 0x850b40]ac-tex damaged at 18 7 [mpeg2video @ 0x850b40]invalid cbp at 14 9 [mpeg2video @ 0x850b40]ac-tex damaged at 1 14 [mpeg2video @ 0x850b40]ac-tex damaged at 2 15 [mpeg2video @ 0x850b40]ac-tex damaged at 0 16 [mpeg2video @ 0x850b40]invalid cbp at 18 17 [mpeg2video @ 0x850b40]Warning MVs not available [mpeg2video @ 0x850b40]concealing 396 DC, 396 AC, 396 MV errors Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 47424061009952 (LWP 17018)] 0x00002b21c6324b34 in mallopt () from /lib/libc.so.6 (gdb) bt #0 0x00002b21c6324b34 in mallopt () from /lib/libc.so.6 #1 0x00002b21c63251ee in free () from /lib/libc.so.6 #2 0x00000000007a2c01 in av_freep (arg=) at libavutil/mem.c:121 #3 0x000000000051ccb4 in MPV_common_end (s=0xce1ac0) at libavcodec/mpegvideo.c:263 #4 0x000000000065ac2a in mpeg_decode_end (avctx=) at libavcodec/mpeg12.c:2433 #5 0x00000000004971a8 in avcodec_close (avctx=0xce5700) at libavcodec/utils.c:972 #6 0x000000000042bbdf in av_find_stream_info (ic=0xc63490) at libavformat/utils.c:2053 #7 0x000000000041a7e9 in opt_input_file (filename=0x7fffe4db8e26 "pedestrians-bug001-minimal.gxf") at ffmpeg.c:2746 #8 0x00000000004222fa in parse_options (argc=3, argv=0x7fffe4db79f8, options=0x833fc0, parse_arg_function=0x41b020 ) at cmdutils.c:150 #9 0x000000000041efbf in main (argc=3, argv=0x7fffe4db79f8) at ffmpeg.c:3830 (gdb) (gdb) frame 4 #4 0x000000000065ac2a in mpeg_decode_end (avctx=) at libavcodec/mpeg12.c:2433 2433 MPV_common_end(&s->mpeg_enc_ctx); (gdb) list 2428 static int mpeg_decode_end(AVCodecContext *avctx) 2429 { 2430 Mpeg1Context *s = avctx->priv_data; 2431 2432 if (s->mpeg_enc_ctx_allocated) 2433 MPV_common_end(&s->mpeg_enc_ctx); 2434 return 0; 2435 } 2436 2437 AVCodec mpeg1video_decoder = { (gdb) print s->mpeg_enc_ctx $1 = {avctx = 0x8080808080808080, width = -2139062144, height = -2139062144, gop_size = -2139062144, intra_only = -2139062144, bit_rate = -2139062144, out_format = 2155905152, h263_pred = -2139062144, h263_plus = -2139062144, h263_msmpeg4 = -2139062144, h263_flv = -2139062144, codec_id = 2155905152, fixed_qscale = -2139062144, encoding = -2139062144, flags = -2139062144, flags2 = -2139062144, max_b_frames = -2139062144, luma_elim_threshold = -2139062144, chroma_elim_threshold = -2139062144, strict_std_compliance = -2139062144, workaround_bugs = -2139062144, codec_tag = -2139062144, stream_codec_tag = -2139062144, pb = {bit_buf = 2155905152, bit_left = -2139062144, buf = 0x8080808080808080 So, the s->mpeg_enc_ctx appears to be uninitialized.