mjpeg over rtp decoding crash
Hi!
Sorry for my bad english...
I use vlc for playing live video from ip camera over rtsp (mjpeg hd video rtp stream). So, sometimes there is a crash while mjpeg block decoding.
I think it happens only if live555 drops trailing data (jpeg frame is too large).
To crash the vlc you have to play the stream (mjpeg hd video stream) for about two seconds then stop it and play it again. Do it for sometimes continously.
Version of vlc = 1.1.9. Version of ffmpeg = 0.6.
beloborodov@beloborodov:~/development/vlc-1.1.9$ gdb vlc
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/beloborodov/Development/vlc-1.1.9/vlc...done.
(gdb) run
Starting program: /home/beloborodov/Development/vlc-1.1.9/vlc
[Thread debugging using libthread_db enabled]
VLC media player 1.1.9 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
/home/beloborodov/Development/vlc-1.1.9/vlc(unsetenv+0x5b)[0x804970b]
/lib/libdbus-1.so.3(+0x33038)[0xb7eb5038]
/lib/libdbus-1.so.3(+0x9bf6)[0xb7e8bbf6]
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
/home/beloborodov/Development/vlc-1.1.9/vlc(unsetenv+0x5b)[0x804970b]
/lib/libdbus-1.so.3(+0x33038)[0xb7eb5038]
/lib/libdbus-1.so.3(+0x9d46)[0xb7e8bd46]
[New Thread 0xb7994b70 (LWP 16047)]
[New Thread 0xb7913b70 (LWP 16048)]
[0x804ca38] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[New Thread 0xb6e99b70 (LWP 16049)]
Blocked: call to setlocale(6, "")
/home/beloborodov/Development/vlc-1.1.9/vlc(setlocale+0x6f)[0x804969f]
/usr/lib/libQtCore.so.4(_ZN16QCoreApplication4initEv+0x36)[0xb74bff16]
/usr/lib/libQtCore.so.4(_ZN16QCoreApplicationC2ER23QCoreApplicationPrivate+0x44)[0xb74c0094]
[New Thread 0xb5de1b70 (LWP 16050)]
Warning: call to srand(1304516134)
/home/beloborodov/Development/vlc-1.1.9/vlc(srand+0x41)[0x8049491]
/usr/lib/libORBit-2.so.0(ORBit_init_internals+0xcb)[0xb5e16a4b]
/usr/lib/libORBit-2.so.0(CORBA_ORB_init+0x1ee)[0xb5e1e0de]
Warning: call to rand()
/home/beloborodov/Development/vlc-1.1.9/vlc(rand+0x3a)[0x804985a]
/usr/lib/libORBit-2.so.0(+0x3da2b)[0xb5e3ba2b]
/usr/lib/libORBit-2.so.0(link_protocol_get_sockaddr+0x39)[0xb5e3b719]
Blocked: call to setlocale(6, "")
/home/beloborodov/Development/vlc-1.1.9/vlc(setlocale+0x6f)[0x804969f]
/usr/lib/libgtk-x11-2.0.so.0(+0x12f49e)[0xb515f49e]
/usr/lib/libgtk-x11-2.0.so.0(gtk_parse_args+0x3c)[0xb515f6ac]
(process:16040): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Warning: call to rand()
/home/beloborodov/Development/vlc-1.1.9/vlc(rand+0x3a)[0x804985a]
/usr/lib/libcairo.so.2(+0x3db3c)[0xb4f9fb3c]
/usr/lib/libcairo.so.2(+0x6e353)[0xb4fd0353]
Warning: call to rand()
/home/beloborodov/Development/vlc-1.1.9/vlc(rand+0x3a)[0x804985a]
/usr/lib/libcairo.so.2(+0x3db3c)[0xb4f9fb3c]
/usr/lib/libcairo.so.2(+0x6e353)[0xb4fd0353]
Warning: call to rand()
/home/beloborodov/Development/vlc-1.1.9/vlc(rand+0x3a)[0x804985a]
/usr/lib/libcairo.so.2(+0x3db3c)[0xb4f9fb3c]
/usr/lib/libcairo.so.2(+0x6e353)[0xb4fd0353]
Warning: call to rand()
/home/beloborodov/Development/vlc-1.1.9/vlc(rand+0x3a)[0x804985a]
/usr/lib/libcairo.so.2(+0x3db3c)[0xb4f9fb3c]
/usr/lib/libcairo.so.2(+0x6e353)[0xb4fd0353]
[New Thread 0xb45b0b70 (LWP 16055)]
[New Thread 0xb44aeb70 (LWP 16057)]
[New Thread 0xb452fb70 (LWP 16056)]
[Thread 0xb45b0b70 (LWP 16055) exited]
Blocked: call to setlocale(6, "POSIX")
/home/beloborodov/Development/vlc-1.1.9/vlc(setlocale+0x6f)[0x804969f]
/home/beloborodov/Development/vlc-1.1.9/modules/demux/.libs/liblive555_plugin.so(_ZN15MediaSubsession24parseSDPAttribute_rtpmapEPKc+0xdb)[0xb43fb0fb]
/home/beloborodov/Development/vlc-1.1.9/modules/demux/.libs/liblive555_plugin.so(_ZN12MediaSession17initializeWithSDPEPKc+0x3e3)[0xb43fd003]
Blocked: call to setlocale(6, "en_US.utf8")
/home/beloborodov/Development/vlc-1.1.9/vlc(setlocale+0x6f)[0x804969f]
/home/beloborodov/Development/vlc-1.1.9/modules/demux/.libs/liblive555_plugin.so(_ZN6LocaleD1Ev+0x26)[0xb43fea76]
/home/beloborodov/Development/vlc-1.1.9/modules/demux/.libs/liblive555_plugin.so(_ZN15MediaSubsession24parseSDPAttribute_rtpmapEPKc+0x107)[0xb43fb127]
Blocked: call to setlocale(6, "POSIX")
/home/beloborodov/Development/vlc-1.1.9/vlc(setlocale+0x6f)[0x804969f]
/home/beloborodov/Development/vlc-1.1.9/modules/demux/.libs/liblive555_plugin.so(_ZN15MediaSubsession24parseSDPAttribute_rtpmapEPKc+0xdb)[0xb43fb0fb]
/home/beloborodov/Development/vlc-1.1.9/modules/demux/.libs/liblive555_plugin.so(_ZN12MediaSession17initializeWithSDPEPKc+0x3e3)[0xb43fd003]
[New Thread 0xb45b0b70 (LWP 16058)]
[New Thread 0xb31cdb70 (LWP 16059)]
[Thread 0xb44aeb70 (LWP 16057) exited]
[New Thread 0xaf14bb70 (LWP 16060)]
MultiFramedRTPSource::doGetNextFrame1(): The total received frame size exceeds the client's buffer size (65536). 67 bytes of trailing data will be dropped!
[New Thread 0xb44aeb70 (LWP 16061)]
MultiFramedRTPSource::doGetNextFrame1(): The total received frame size exceeds the client's buffer size (131072). 1083 bytes of trailing data will be dropped!
[New Thread 0xae5f1b70 (LWP 16062)]
error count: 268435512
error y=19 x=52
error count: 268435512
error y=19 x=52
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb45b0b70 (LWP 16058)]
decode_block (s=0x852d9e0) at /build/buildd/ffmpeg-0.6/libavcodec/mjpegdec.c:410
warning: Source file is more recent than executable.
410 UPDATE_CACHE(re, &s->gb);
(gdb) bt
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) decode_block (s=0x852d9e0) at /build/buildd/ffmpeg-0.6/libavcodec/mjpegdec.c:410
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) mjpeg_decode_scan (s=0x852d9e0) at /build/buildd/ffmpeg-0.6/libavcodec/mjpegdec.c:812
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) ff_mjpeg_decode_sos (s=0x852d9e0) at /build/buildd/ffmpeg-0.6/libavcodec/mjpegdec.c:997
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0xb3622653 in ff_mjpeg_decode_frame (avctx=0x852b2d0, data=0x852a3f0, data_size=0xb45b016c, avpkt=0xb45b0094) at /build/buildd/ffmpeg-0.6/libavcodec/mjpegdec.c:1464
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0xb3756bd5 in avcodec_decode_video2 (avctx=0x852b2d0, picture=0x852a3f0, got_picture_ptr=0xb45b016c, buf=0xb54bc750 "\377\330\377", <incomplete sequence \340>,
buf_size=131072) at /build/buildd/ffmpeg-0.6/libavcodec/utils.c:611
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) avcodec_decode_video (avctx=0x852b2d0, picture=0x852a3f0, got_picture_ptr=0xb45b016c, buf=0xb54bc750 "\377\330\377", <incomplete sequence \340>, buf_size=131072)
at /build/buildd/ffmpeg-0.6/libavcodec/utils.c:597
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0xb3e5cbd9 in DecodeVideo (p_dec=0x8520f90, pp_block=0xb45b020c) at video.c:550
[#7](https://code.videolan.org/videolan/vlc/-/issues/7) 0xb7f17562 in DecoderDecodeVideo (p_dec=<value optimized out>, p_block=0xb54bc6f0) at input/decoder.c:1466
[#8](https://code.videolan.org/videolan/vlc/-/issues/8) 0xb7f16d25 in DecoderProcessVideo (p_dec=<value optimized out>, p_block=0x2048d) at input/decoder.c:1835
[#9](https://code.videolan.org/videolan/vlc/-/issues/9) DecoderProcess (p_dec=<value optimized out>, p_block=0x2048d) at input/decoder.c:2007
[#10](https://code.videolan.org/videolan/vlc/-/issues/10) 0xb7f16e3a in DecoderThread (p_this=0x8520f90) at input/decoder.c:892
[#11](https://code.videolan.org/videolan/vlc/-/issues/11) 0xb7f76ab8 in thread_entry (data=0x8521350) at misc/threads.c:58
[#12](https://code.videolan.org/videolan/vlc/-/issues/12) 0xb7e3ecc9 in start_thread () from /lib/libpthread.so.0
[#13](https://code.videolan.org/videolan/vlc/-/issues/13) 0xb7da869e in clone () from /lib/libc.so.6
(gdb) list
405 block[0] = val;
406 /* AC coefs */
407 i = 0;
408 {OPEN_READER(re, &s->gb)
409 for(;;) {
410 UPDATE_CACHE(re, &s->gb);
411 GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
412
413 /* EOB */
414 if (code == 0x10)