libmpeg2: crash if video output creation fails
When libmpeg2
is used as video decoder and an unsupported video output is selected, VLC crashes at playback start.
When libavcodec is used or a supported video output is used, VLC does not crash (but instead displays no video during playback).
Used command line under Linux (latest Git version): \
vlc --codec libmpeg2 --vout sdl video.m2v
Used command line under Windows 7 (nightly build from 24th May): \
vlc --codec libmpeg2 --vout caca video.m2v
I attach the mentioned file, but any other MPEG-2 Video file should work as well.
The console log under Linux correctly states that the video output could not be created:
[00007ff6b0000bd8] core video output error: video output creation failed
[00007ff6d0004128] core decoder error: failed to create video output
The respective backtrace after the crash by gdb:
[#0](https://code.videolan.org/videolan/vlc/-/issues/0) decoder_SynchroNewPicture (p_synchro=0x0, i_coding_type=2, i_repeat_field=2, next_pts=next_pts@entry=1, next_dts=next_dts@entry=1, b_low_delay=false) at input/decoder_synchro.c:410
[#1](https://code.videolan.org/videolan/vlc/-/issues/1) 0x00007fffb3642f00 in DecodeBlock (pp_block=<synthetischer Zeiger>, p_dec=0x7fffd0c19ee8) at codec/libmpeg2.c:382
[#2](https://code.videolan.org/videolan/vlc/-/issues/2) DecodeVideo (p_dec=0x7fffd0c19ee8, p_block=0x7fffd013bbc0) at codec/libmpeg2.c:613
[#3](https://code.videolan.org/videolan/vlc/-/issues/3) 0x00007ffff710d07b in DecoderDecode (p_dec=0x7fffd0c19ee8, p_block=0x7fffd013bbc0) at input/decoder.c:1290
[#4](https://code.videolan.org/videolan/vlc/-/issues/4) 0x00007ffff710cc44 in DecoderProcess (p_dec=p_dec@entry=0x7fffd0c19ee8, p_block=p_block@entry=0x7fffd013bbc0) at input/decoder.c:1413
[#5](https://code.videolan.org/videolan/vlc/-/issues/5) 0x00007ffff710d2ff in DecoderThread (p_data=<optimized out>) at input/decoder.c:1568
[#6](https://code.videolan.org/videolan/vlc/-/issues/6) 0x00007ffff799c6ba in start_thread (arg=0x7fffb3a47700) at pthread_create.c:333
[#7](https://code.videolan.org/videolan/vlc/-/issues/7) 0x00007ffff74ce82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109