vrawdepay: fix length check

Add some more debugging.
Add the length check so we don't cause unneeded warnings.
This commit is contained in:
Wim Taymans 2011-01-05 15:03:32 +01:00
parent 43c6d0c72a
commit 6b91c5f6e7

View file

@ -242,6 +242,7 @@ gst_rtp_vraw_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
GST_DEBUG_OBJECT (depayload, "width %d, height %d, format %d", width, height,
format);
GST_DEBUG_OBJECT (depayload, "yp %d, up %d, vp %d", yp, up, vp);
GST_DEBUG_OBJECT (depayload, "xinc %d, yinc %d", xinc, yinc);
GST_DEBUG_OBJECT (depayload, "pgroup %d, ystride %d, uvstride %d", pgroup,
ystride, uvstride);
GST_DEBUG_OBJECT (depayload, "outsize %u", outsize);
@ -386,10 +387,10 @@ gst_rtp_vraw_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
}
/* calculate the maximim amount of bytes we can use per line */
if (offs + ((length / pgroup) * xinc) > (width - xinc)) {
if (offs + ((length / pgroup) * xinc) > width) {
plen = ((width - offs) * pgroup) / xinc;
GST_WARNING_OBJECT (depayload, "clipping length %d, offset %d", length,
offs);
GST_WARNING_OBJECT (depayload, "clipping length %d, offset %d, plen %d",
length, offs, plen);
} else
plen = length;