[MPlayer-users] SIGSEGV when play MPEG2 file after Mencoder

byavl byavl at papillon.ru
Wed Nov 17 13:49:01 CET 2004


Hi guys.

Again I had crashed mplayer. :)

MPlayer dev-CVS-041115-10:00-3.2.2 (C) 2000-2004 MPlayer Team

I had a look into code under gdb and I'm confused a bit.
Error is in include directive using.
I have many years programming and one of many rules for me is
don't use complex and many lines include expressions.
It's fountain hardly traced and understanding errors.
Again pointer has no tested to NULL.
Look:

source call is parse_es.c line: 31
----------------------------------

    videobuf_code[videobuf_code_len++]=demux_getc(ds);


buggy code is demuxer.h  line: 227   take a look to demux_getc(ds)
What happens if ds->buffer is NULL ? Right! SIGSEGV
----------------------------------------------------

#if 1
#define demux_getc(ds) (\
      (ds->buffer_pos<ds->buffer_size) ? ds->buffer[ds->buffer_pos++] \
      :((!ds_fill_buffer(ds))? (-1) : ds->buffer[ds->buffer_pos++] ) )
#else
inline static int demux_getc(demux_stream_t *ds){
   if(ds->buffer_pos>=ds->buffer_size){
     if(!ds_fill_buffer(ds)){
//      printf("DEMUX_GETC: EOF reached!\n");
       return -1; // EOF
     }
   }
//  printf("[%02X]",ds->buffer[ds->buffer_pos]);
   return ds->buffer[ds->buffer_pos++];
}
#endif

My suggestion is release it code as function.
It will best solution.

ps: I'm sorry but I can't upload my mpeg file now.

Thanks and best regards.

-- 
Aleksey Lekhtin
byavl at papillon.ru   ICQ: 15146863, AIM: byavl




More information about the MPlayer-users mailing list