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;
}
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;
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;
}
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;
&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);
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);