Commit 6a16be75 authored by Luis de Bethencourt's avatar Luis de Bethencourt
Browse files

rtph263pay: fix leak

Free memory of current macroblock once it isn't needed so it isn't leaked
by the call of the gst_rtp_h263_pay_B_mbfinder function.
if (!(mac = gst_rtp_h263_pay_B_mbfinder (context, gob, mac, mb))) {

CID 1212156
parent 41d2b6f1
......@@ -952,19 +952,16 @@ static GstRtpH263PayMB *
gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context,
GstRtpH263PayGob * gob, GstRtpH263PayMB * macroblock, guint mba)
{
guint mb_type_index;
guint cbpy_type_index;
guint tcoef_type_index;
GstRtpH263PayMB *mac;
GstRtpH263PayBoundry boundry;
gst_rtp_h263_pay_boundry_init (&boundry, macroblock->end,
macroblock->end, 8 - macroblock->ebit, macroblock->ebit);
mac = gst_rtp_h263_pay_mb_new (&boundry, mba);
if (mac->sbit == 8) {
mac->start++;
// mac->end++;
......@@ -974,6 +971,9 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context,
GST_LOG ("current_pos:%p, end:%p, rest_bits:%d, window:%x",
mac->start, mac->end, macroblock->ebit, context->window);
/* macroblock isn't needed anymore */
gst_rtp_h263_pay_mb_destroy (macroblock);
GST_LOG ("Current pos after COD: %p", mac->end);
if (context->piclayer->ptype_pictype == 0) {
......@@ -1225,7 +1225,6 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context,
return mac;
beach:
gst_rtp_h263_pay_mb_destroy (mac);
return NULL;
}
......@@ -1589,7 +1588,6 @@ gst_rtp_h263_pay_mode_B_fragment (GstRtpH263Pay * rtph263pay,
}
/*---------- END OF MODE B FRAGMENTATION ----------*/
gst_rtp_h263_pay_mb_destroy (mac);
return TRUE;
......
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