From d7fafc551a96b912c8eea77cdfb43c641903df26 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 29 Aug 2011 13:52:16 +0200 Subject: [PATCH] codecparsers: h264: fix NAL reader initialization. --- gst-libs/gst/codecparsers/gsth264parser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index a4c09c0acf..964d937167 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.c +++ b/gst-libs/gst/codecparsers/gsth264parser.c @@ -1289,7 +1289,7 @@ gst_h264_parse_sps (GstH264NalUnit * nalu, GstH264SPS * sps, GstH264VUIParams *vui = NULL; GST_DEBUG ("parsing SPS"); - nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size); + nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1); /* set default values for fields that might not be present in the bitstream and have valid defaults */ @@ -1462,7 +1462,7 @@ gst_h264_parse_pps (GstH264NalParser * nalparser, GstH264NalUnit * nalu, GST_DEBUG ("parsing PPS"); - nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size); + nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1); READ_UE_ALLOWED (&nr, pps->id, 0, GST_H264_MAX_PPS_COUNT); READ_UE_ALLOWED (&nr, sps_id, 0, GST_H264_MAX_SPS_COUNT); @@ -1627,7 +1627,7 @@ gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser, } - nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size); + nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1); READ_UE (&nr, slice->first_mb_in_slice); READ_UE (&nr, slice->type); @@ -1799,7 +1799,7 @@ gst_h264_parser_parse_sei (GstH264NalParser * nalparser, GstH264NalUnit * nalu, GST_DEBUG ("parsing \"Sei message\""); - nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size); + nal_reader_init (&nr, nalu->data + nalu->offset + 1, nalu->size - 1); sei->payloadType = 0; do {