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:
Thiago Santos 2010-01-12 09:35:24 -03:00
parent b3f0b029f3
commit ddeb6e17fd

View file

@ -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;