Commit 78079635 authored by Sebastian Dröge's avatar Sebastian Dröge

dvdepay: Fix 'comparison of unsigned expression >= 0 is always true' compiler warning

This was an actual bug as it could've caused reading from
invalid memory areas when the input is broken.
parent dad2a52f
...@@ -336,12 +336,14 @@ gst_rtp_dv_depay_process (GstBaseRTPDepayload * base, GstBuffer * in) ...@@ -336,12 +336,14 @@ gst_rtp_dv_depay_process (GstBaseRTPDepayload * base, GstBuffer * in)
GST_LOG_OBJECT (dvdepay, "got block at location %d", location); GST_LOG_OBJECT (dvdepay, "got block at location %d", location);
} }
/* get the byte offset of the dif block */ if (location != -1) {
offset = location * 80; /* get the byte offset of the dif block */
offset = location * 80;
/* And copy it in, provided the location is sane. */ /* And copy it in, provided the location is sane. */
if (offset >= 0 && offset <= dvdepay->frame_size - 80) if (offset <= dvdepay->frame_size - 80)
memcpy (GST_BUFFER_DATA (dvdepay->acc) + offset, payload, 80); memcpy (GST_BUFFER_DATA (dvdepay->acc) + offset, payload, 80);
}
payload += 80; payload += 80;
payload_len -= 80; payload_len -= 80;
......
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