From: <thi...@ke...> - 2010-01-12 13:03:57
|
Module: gst-plugins-bad Branch: master Commit: ddeb6e17fda2184b39353ef1472845654eab3339 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=ddeb6e17fda2184b39353ef1472845654eab3339 Author: Thiago Santos <thi...@co...> Date: Tue Jan 12 09:35:24 2010 -0300 mpegtsmux: Do not crash on misinterpreted h264 Avoid crashing when bytestream h264 is interpreted as avc format h264 Fixes #606657 --- gst/mpegtsmux/mpegtsmux_h264.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/gst/mpegtsmux/mpegtsmux_h264.c b/gst/mpegtsmux/mpegtsmux_h264.c index 5824f35..f43bc09 100644 --- a/gst/mpegtsmux/mpegtsmux_h264.c +++ b/gst/mpegtsmux/mpegtsmux_h264.c @@ -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; |