Commit d37f842a authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Edward Hervey

codecparsers: h264: handle end-of-seq and end-of-stream NAL gracefully.

parent ccfd7616
......@@ -1124,8 +1124,8 @@ gst_h264_parser_identify_nalu (GstH264NalParser * nalparser,
{
gint off1, off2;
if (size - 4 <= offset) {
GST_DEBUG ("Can't parse, buffer is to small size %u, offset %u", size,
if (size - offset < 4) {
GST_DEBUG ("Can't parse, buffer has too small size %u, offset %u", size,
offset);
return GST_H264_PARSER_ERROR;
}
......@@ -1153,6 +1153,13 @@ gst_h264_parser_identify_nalu (GstH264NalParser * nalparser,
nalu->data = (guint8 *) data;
set_nalu_datas (nalu);
if (nalu->type == GST_H264_NAL_SEQ_END ||
nalu->type == GST_H264_NAL_STREAM_END) {
GST_DEBUG ("end-of-seq or end-of-stream nal found");
nalu->size = 0;
return GST_H264_PARSER_OK;
}
off2 = scan_for_start_codes (data + nalu->offset, size - nalu->offset);
if (off2 < 0) {
GST_DEBUG ("Nal start %d, No end found", nalu->offset);
......
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