diff options
author | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2013-11-11 13:15:54 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2013-11-11 13:25:22 +0100 |
commit | 8c1be8796e58bfcab7c9b9ac2ca089b10bf803b4 (patch) | |
tree | d4f6c31d97ade2a06d4f88c8862aea101b14948c /ext | |
parent | 02b2eeeb9a72452c0a38fd9cdb6c61a6a008b510 (diff) |
mpeg2dec: graceful degradation for badly parsed input
Diffstat (limited to 'ext')
-rw-r--r-- | ext/mpeg2dec/gstmpeg2dec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 03c8b4e3..811e0525 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -406,6 +406,13 @@ gst_mpeg2dec_alloc_sized_buf (GstMpeg2dec * mpeg2dec, guint size, state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (mpeg2dec)); if (!mpeg2dec->need_cropping || mpeg2dec->has_cropping) { + /* need parsed input, but that might be slightly bogus, + * so avoid giving up altogether and mark it as error */ + if (frame->output_buffer) { + gst_buffer_replace (&frame->output_buffer, NULL); + GST_VIDEO_DECODER_ERROR (mpeg2dec, 1, STREAM, DECODE, + ("decoding error"), ("Input not correctly parsed"), ret); + } ret = gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER (mpeg2dec), frame); |