Skip to content
Snippets Groups Projects

vpxdec: Check that output width and height != 0

Merged Sebastian Dröge requested to merge slomo/gst-plugins-good:vpxdec-width-zero into master
2 files
+ 42
0
Compare changes
  • Side-by-side
  • Inline
Files
2
  • d98d5656
    For VP8 it's possible to signal width or height to be 0, but it does
    not make sense to do so. For VP9 it's impossible. Hence, we most
    likely have a corrupt stream. Trying to negotiate caps downstream with
    either width or height as 0 will fail with something like
    
    gst_video_decoder_negotiate_default: assertion 'GST_VIDEO_INFO_WIDTH (&state->info) != 0' failed
    
    Part-of: <!610>
+ 8
0
@@ -586,6 +586,14 @@ gst_vpx_dec_open_codec (GstVPXDec * dec, GstVideoCodecFrame * frame)
GST_WARNING_OBJECT (dec, "No keyframe, skipping");
return GST_FLOW_CUSTOM_SUCCESS_1;
}
if (stream_info.w == 0 || stream_info.h == 0) {
/* For VP8 it's possible to signal width or height to be 0, but it does
* not make sense to do so. For VP9 it's impossible. Hence, we most likely
* have a corrupt stream if width or height is 0. */
GST_INFO_OBJECT (dec, "Invalid resolution %d x %d", stream_info.w,
stream_info.h);
return GST_FLOW_CUSTOM_SUCCESS_1;
}
gst_vpx_dec_set_stream_info (dec, &stream_info);
gst_vpx_dec_set_default_format (dec, GST_VIDEO_FORMAT_I420, stream_info.w,
Loading