[MPlayer-dev-eng] demux_asf.c demux_asf_fill_buffer: asf->packetsize ==0

Attila Kinali attila at kinali.ch
Sun Oct 7 13:04:06 CEST 2007


Moin,

I stumbled over a bug where asf->packetsize is 0 and thus
asf->packet (the buffer for the packets) is never allocated.
---
MPlayer dev-SVN-r24717-4.2.1 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3700+ (Family: 15, Model: 55, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
this_opt = option: v
Setting v=/tmp/blah
Adding file /tmp/blah
Config pushed level is now 2
Config pushed level is now 3
get_path('codecs.conf') -> '/home/attila/.mplayer/codecs.conf'
Reading /home/attila/.mplayer/codecs.conf: Can't open '/home/attila/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open '/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
Configuration: --enable-debug
CommandLine: '-v' '-v' '-v' '/tmp/blah'
[fontconfig stuff]
[[[init getch2]]]

Playing /tmp/blah.
get_path('sub/') -> '/home/attila/.mplayer/sub/'
[file] File size is 90853460 bytes
STREAM: [file] /tmp/blah
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
seek to 0x0
s->pos=0  newpos=0  new_bufpos=0  buflen=0  
LAVF_check: asf format
DEMUXER: freeing demuxer at 0xf1d820
seek to 0x0
DEMUXER: freeing demuxer at 0xf1d820
seek to 0x0
Checking for YUV4MPEG2
DEMUXER: freeing demuxer at 0xf1d820
seek to 0x0
ASF file format detected.
stream type: guid_audio_stream
stream concealment: guid_audio_conceal_interleave
type: 28 bytes,  stream: 24 bytes  ID: 1
unk1: 0  unk2: 196B40
FILEPOS=0x172
==> Found audio stream: 1
[asfheader] Audio stream found, -aid 1
======= WAVE Format =======
Format Tag: 353 (0x161)
Channels: 2
Samplerate: 44100
avg byte/sec: 8010
Block align: 372
bits/sample: 16
cbSize: 10
Unknown extra header dump: [0] [8] [0] [0] [1] [0] [74] [1] [0] [0] 
==========================================================================
ASF: audio scrambling: 1 x 1 x 1116
stream type: guid_video_stream
stream concealment: unknown guid 0057fb20-555b-cf11-a8fd00805f5c442b
type: 51 bytes,  stream: 0 bytes  ID: 2
unk1: 0  unk2: 196B40
FILEPOS=0x1E4
==> Found video stream: 2
[asfheader] Video stream found, -vid 2
======= VIDEO Format ======
  biSize 40
  biWidth 320
  biHeight 240
  biPlanes 1
  biBitCount 24
  biCompression 859066445='MP43'
  biSizeImage 230400
===========================
Found movie at 0x33F - 0x56A2F8E
ASF: 1 audio and 1 video streams found
seek to 0x33F
ds_fill_buffer(d_video) called

Program received signal SIGSEGV, Segmentation fault.
0x0000000000528811 in demux_asf_fill_buffer (demux=0xf1d820, ds=0xf1e9b0)
    at demux_asf.c:344
344                 unsigned char flags=p[0];

(gdb) bt
#0  0x0000000000528811 in demux_asf_fill_buffer (demux=0xf1d820, ds=0xf1e9b0)
    at demux_asf.c:344
#1  0x00000000005241f3 in demux_fill_buffer (demux=0xf1d820, ds=0xf1e9b0)
    at demuxer.c:373
#2  0x0000000000524556 in ds_fill_buffer (ds=0xf1e9b0) at demuxer.c:423
#3  0x00000000005296e7 in demux_open_asf (demuxer=0xf1d820) at demux_asf.c:642
#4  0x00000000005252b8 in demux_open_stream (stream=0xf1ce60, file_format=6, 
    force=0, audio_id=-1, video_id=-1, dvdsub_id=-2, 
    filename=0xec91c0 "/tmp/blah") at demuxer.c:732
#5  0x00000000005259d6 in demux_open (vs=0xf1ce60, file_format=0, audio_id=-1, 
    video_id=-1, dvdsub_id=-2, filename=0xec91c0 "/tmp/blah") at demuxer.c:872
#6  0x00000000004641ce in main (argc=5, argv=0x7fffcd435b78) at mplayer.c:2949
(gdb) p *asf
$1 = {header = {objh = {guid = "0&²u\216fÏ\021¦Ù\000ª\000bÎl", size = 781}, 
    cno = 6, v1 = 1 '\001', v2 = 2 '\002'}, packet = 0x0, scrambling_h = 1, 
  scrambling_w = 1, scrambling_b = 1116, packetsize = 0, packetrate = 0, 
  movielength = 0, asf_is_dvr_ms = 0, asf_frame_state = 0, 
  asf_frame_start_found = 0, dvr_last_vid_pts = 0, vid_frame_ct = 0, 
  play_duration = 0, num_packets = 0, new_vid_frame_seg = 0, 
  vid_repdata_sizes = 0x0, aud_repdata_sizes = 0x0, vid_repdata_count = 0, 
  aud_repdata_count = 0, avg_vid_frame_time = 0, last_key_payload_time = 0, 
  last_aud_pts = 0, last_aud_diff = 0, found_first_key_frame = 0, 
  last_vid_seq = 4294967295, vid_ext_timing_index = -1, 
  aud_ext_timing_index = -1, vid_ext_frame_index = -1, know_frame_time = 0, 
  bps = 0}
---

I'm not exactly sure why packetsize is never set (looks like the header
was not correctly recognized), but i think, that demux_asf_fill_buffer
should either never been called in that case or bail out imediatly.

Can someone who understands the code a little bit more give a comment
what should be done in this case?

			Attila Kinali

-- 
Linux ist... wenn man einfache Dinge auch mit einer kryptischen
post-fix Sprache loesen kann
                        -- Daniel Hottinger



More information about the MPlayer-dev-eng mailing list