Opened 11 years ago

Last modified 9 years ago

#1302 closed defect (fixed)

mencoder crashes decoding MJPG AVI

Reported by: rectalogic@… Owned by: r_togni@…
Priority: normal Component: demuxer
Version: HEAD Severity: normal
Keywords: Cc: compn
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


mencoder crashes when transcoding an MJPG AVI captured from a webcam. It successfully transcodes other captures from the same webcam. Uploaded sample to incoming/mjpg-mencoder-crash/mjpg-mencoder-crash.avi

Command line used was:

mencoder -v -msglevel demux=8:demuxer=8 mjpg-mencoder-crash.avi -of lavf -lavfopts format=mov -ovc raw -oac pcm -o

I noticed ds_fill_buffer reading zero bytes:

ds_fill_buffer(d_video) called
Auto-selected AVI video ID = 0
demux_avi.read_packet: 63643030
DEMUX_AVI: Read 0 data bytes from packet 63643030
DEMUX: Append packet to d_video, len=0 pts=0.000 pos=4294967295 [packs: A=0 V=1]

So we never decode the first frame, and never set codec width/height and so av_write_header() complains:

[mov @ 0x88ef90]dimensions not set

And then later we get "Floating point exception"

Program received signal EXC_ARITHMETIC, Arithmetic exception.
0x901dceeb in divdi3 ()
(gdb) bt
#0 0x901dceeb in
divdi3 ()
#1 0x001aabab in av_frac_add (f=0x1434b80, incr=992250000) at utils.c:87
#2 0x001b276b in compute_pkt_fields2 (st=0x1434b60, pkt=0xbfffed68) at utils.c:2576
#3 0x001b2c78 in av_interleaved_write_frame (s=0x180b200, pkt=0xbfffed68) at utils.c:2678
#4 0x0001f818 in write_chunk (stream=0x1434aa0, len=22050, flags=16, dts=0, pts=0) at libmpdemux/muxer_lavf.c:261
#5 0x0000e97f in muxer_write_chunk (s=0x1434aa0, len=0, flags=0, dts=0, pts=0) at libmpdemux/muxer.c:125
#6 0x00006500 in main (argc=12, argv=0xbffff4b8) at mencoder.c:1388
(gdb) up
#1 0x001aabab in av_frac_add (f=0x1434b80, incr=992250000) at utils.c:87
87 f->val += num / den;
(gdb) p *f
$45 = {

val = 0,
num = 0,
den = 0


Attachments (1)

mencoder-crash.log (14.5 KB) - added by rectalogic@… 11 years ago.
mencoder log

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by rectalogic@…

mencoder log

comment:1 Changed 11 years ago by rectalogic@…

comment:2 Changed 10 years ago by compn

still crashes

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x48024d20 (LWP 12168)]
mov_write_packet (s=0x10a3a6a0, pkt=0xbfca9f08) at movenc.c:1747
1747 AVCodecContext *enc = trk->enc;
(gdb) bt
#0 mov_write_packet (s=0x10a3a6a0, pkt=0xbfca9f08) at movenc.c:1747
#1 0x101de4c4 in av_interleaved_write_frame (s=<value optimized out>, pkt=0x0) at utils.c:2768
#2 0x10044d44 in write_chunk (stream=0x10a3b630, len=614400, flags=<value optimized out>, dts=0.066666666666666666,

pts=0.066666666666666666) at libmpdemux/muxer_lavf.c:261

#3 0x10037d50 in muxer_write_chunk (s=0x10a3b630, len=614400, flags=16, dts=0.066666666666666666, pts=0.066666666666666666)

at libmpdemux/muxer.c:63

#4 0x10037800 in put_image (vf=<value optimized out>, mpi=<value optimized out>, pts=<value optimized out>)

at libmpcodecs/ve_raw.c:127

#5 0x100835bc in vf_next_put_image (vf=<value optimized out>, mpi=<value optimized out>, pts=<value optimized out>)

at libmpcodecs/vf.c:699

#6 0x10090c18 in put_image (vf=0x10a3c5a8, mpi=0x10b75130, pts=-9.2233720368547758e+18) at libmpcodecs/vf_expand.c:376
#7 0x1007b6c0 in filter_video (sh_video=<value optimized out>, frame=0x10b75130, pts=-9.2233720368547758e+18)

at libmpcodecs/dec_video.c:416

#8 0x10031e18 in main (argc=<value optimized out>, argv=<value optimized out>) at mencoder.c:1298

comment:3 Changed 9 years ago by compn

  • Resolution set to fixed
  • Status changed from new to closed,
Note: See TracTickets for help on using tickets.