diff options
author | Alessandro Decina <alessandro.d@gmail.com> | 2011-12-06 12:55:26 +0100 |
---|---|---|
committer | Alessandro Decina <alessandro.d@gmail.com> | 2011-12-06 13:15:58 +0100 |
commit | 702c055645969a53c1837327dcd296fcb08addce (patch) | |
tree | 9c827df158e6ab6e75d4da8ae1ec2f5487c63b7b /gst-libs | |
parent | d8367300aeb2fa3fe571a78c04c0a139d987fdb8 (diff) |
codecparsers: fix compile warnings in gstmpeg4parser.c
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/codecparsers/gstmpeg4parser.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/gst-libs/gst/codecparsers/gstmpeg4parser.c b/gst-libs/gst/codecparsers/gstmpeg4parser.c index f22ba9186..12c63b013 100644 --- a/gst-libs/gst/codecparsers/gstmpeg4parser.c +++ b/gst-libs/gst/codecparsers/gstmpeg4parser.c @@ -430,8 +430,8 @@ gst_mpeg4_parse (GstMpeg4Packet * packet, gboolean skip_user_data, g_return_val_if_fail (packet != NULL, GST_MPEG4_PARSER_ERROR); if (size - offset <= 4) { - GST_DEBUG ("Can't parse, buffer is to small size %d at offset %d", size, - offset); + GST_DEBUG ("Can't parse, buffer is to small size %" G_GSSIZE_FORMAT + " at offset %d", size, offset); return GST_MPEG4_PARSER_ERROR; } @@ -479,7 +479,7 @@ find_end: packet->size = (gsize) off2 - off1 - 3; - GST_DEBUG ("Complete packet of type %x found at: %d, Size: %d", + GST_DEBUG ("Complete packet of type %x found at: %d, Size: %" G_GSSIZE_FORMAT, packet->type, packet->offset, packet->size); return GST_MPEG4_PARSER_OK; @@ -511,8 +511,8 @@ gst_h263_parse (GstMpeg4Packet * packet, g_return_val_if_fail (packet != NULL, GST_MPEG4_PARSER_ERROR); if (size - offset < 3) { - GST_DEBUG ("Can't parse, buffer is to small size %d at offset %d", size, - offset); + GST_DEBUG ("Can't parse, buffer is to small size %" G_GSSIZE_FORMAT + " at offset %d", size, offset); return GST_MPEG4_PARSER_ERROR; } @@ -537,7 +537,7 @@ gst_h263_parse (GstMpeg4Packet * packet, packet->size = (gsize) off2 - off1; - GST_DEBUG ("Complete packet found at: %d, Size: %d", + GST_DEBUG ("Complete packet found at: %d, Size: %" G_GSSIZE_FORMAT, packet->offset, packet->size); return GST_MPEG4_PARSER_OK; @@ -953,10 +953,15 @@ gst_mpeg4_parse_video_object_layer (GstMpeg4VideoObjectLayer * vol, &vol->par_height); } else { + gint v; + READ_UINT8 (&br, vol->par_width, 8); - CHECK_ALLOWED (vol->par_width, 1, 255); + v = vol->par_width; + CHECK_ALLOWED (v, 1, 255); + READ_UINT8 (&br, vol->par_height, 8); - CHECK_ALLOWED (vol->par_height, 1, 255); + v = vol->par_height; + CHECK_ALLOWED (v, 1, 255); } GST_DEBUG ("Pixel aspect ratio %d/%d", vol->par_width, vol->par_width); @@ -1023,7 +1028,11 @@ gst_mpeg4_parse_video_object_layer (GstMpeg4VideoObjectLayer * vol, MARKER_UNCHECKED (&br); vol->vop_time_increment_resolution = gst_bit_reader_get_bits_uint16_unchecked (&br, 16); - CHECK_ALLOWED (vol->vop_time_increment_resolution, 1, G_MAXUINT16); + if (vol->vop_time_increment_resolution < 1) { + GST_WARNING ("value not in allowed range. value: %d, range %d-%d", + vol->vop_time_increment_resolution, 1, G_MAXUINT16); + goto failed; + } vol->vop_time_increment_bits = g_bit_storage (vol->vop_time_increment_resolution); |