mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
mpegtsmux: Do not crash on misinterpreted h264
Avoid crashing when bytestream h264 is interpreted as avc format h264 Fixes #606657
This commit is contained in:
parent
b3f0b029f3
commit
ddeb6e17fd
1 changed files with 6 additions and 0 deletions
|
@ -191,6 +191,12 @@ mpegtsmux_prepare_h264 (GstBuffer * buf, MpegTsPadData * data, MpegTsMux * mux)
|
|||
out_offset += nal_size;
|
||||
}
|
||||
|
||||
if (out_offset > GST_BUFFER_SIZE (out_buf)) {
|
||||
GST_WARNING_OBJECT (mux, "Calculated buffer size %u is greater than max "
|
||||
"expected size %u, using max expected size (Input might not be in "
|
||||
"avc format", out_buf, GST_BUFFER_SIZE (out_buf));
|
||||
out_offset = GST_BUFFER_SIZE (out_buf);
|
||||
}
|
||||
GST_BUFFER_SIZE (out_buf) = out_offset;
|
||||
|
||||
return out_buf;
|
||||
|
|
Loading…
Reference in a new issue