Commit 4459d706 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

avviddec: Don't copy padding if handling a frame failed

We will return an error right afterwards anyway.
parent 099ea5f2
......@@ -1540,18 +1540,18 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
len =
gst_ffmpegviddec_frame (ffmpegdec, data, size, &have_data, frame, &ret);
if (do_padding) {
memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
}
if (ret != GST_FLOW_OK) {
GST_LOG_OBJECT (ffmpegdec, "breaking because of flow ret %s",
gst_flow_get_name (ret));
/* bad flow retun, make sure we discard all data and exit */
/* bad flow return, make sure we discard all data and exit */
bsize = 0;
break;
}
if (do_padding) {
memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
}
if (len == 0 && have_data == 0) {
/* nothing was decoded, this could be because no data was available or
* because we were skipping frames.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment