mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
baseparse: Always clear drain flag before pulling
In pull mode, each pull is unique. A following pull can be well inside the range even if the previous one wasn't. Fix this my moving the drain flag right before the pull. This avoids passing a bad drain flag to parsers, which may endup truncate buffers causing data corruption. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1275 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/446>
This commit is contained in:
parent
a4caf7b254
commit
8ecf0956d7
1 changed files with 1 additions and 1 deletions
|
@ -3524,6 +3524,7 @@ gst_base_parse_scan_frame (GstBaseParse * parse, GstBaseParseClass * klass)
|
|||
|
||||
GST_LOG_OBJECT (parse, "reading buffer size %u", min_size);
|
||||
|
||||
parse->priv->drain = FALSE;
|
||||
ret = gst_base_parse_pull_range (parse, min_size, &buffer);
|
||||
if (ret != GST_FLOW_OK)
|
||||
goto done;
|
||||
|
@ -3592,7 +3593,6 @@ gst_base_parse_scan_frame (GstBaseParse * parse, GstBaseParseClass * klass)
|
|||
/* Double our frame size, or increment by at most 64KB */
|
||||
fsize += MIN (fsize, 64 * 1024);
|
||||
}
|
||||
parse->priv->drain = FALSE;
|
||||
}
|
||||
|
||||
done:
|
||||
|
|
Loading…
Reference in a new issue