From 957eac957952b6f1d3586f6b550e9b0f99f24f90 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 14 Dec 2010 15:27:52 +0100 Subject: [PATCH] j2kpay: stop scanning when we reached the end Stop scanning for markers when we reached the end of the data. --- gst/rtp/gstrtpj2kpay.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/rtp/gstrtpj2kpay.c b/gst/rtp/gstrtpj2kpay.c index de4462e45b..6fc129c9cb 100644 --- a/gst/rtp/gstrtpj2kpay.c +++ b/gst/rtp/gstrtpj2kpay.c @@ -437,6 +437,11 @@ gst_rtp_j2k_pay_handle_buffer (GstBaseRTPPayload * basepayload, } pos = end; + + /* exit when finished */ + if (pos == size) + break; + /* scan next packetization unit and fill in the header */ end = find_pu_end (pay, data, size, pos, &state); } while (TRUE);