From: Vincent Penquerc'h Date: Thu, 12 Jun 2014 09:43:53 +0000 (+0100) Subject: rtph263pay: fix leaks X-Git-Tag: 1.3.3~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ef26e4a8a011273f70a5e1ab4dbd028e5153592;p=platform%2Fupstream%2Fgst-plugins-good.git rtph263pay: fix leaks Coverity 1212149 --- diff --git a/gst/rtp/gstrtph263pay.c b/gst/rtp/gstrtph263pay.c index a9672ec..972c025 100644 --- a/gst/rtp/gstrtph263pay.c +++ b/gst/rtp/gstrtph263pay.c @@ -958,7 +958,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, GST_DEBUG ("MCBPC index: %d", mb_type_index); if (mb_type_index == -1) { GST_ERROR ("MB index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } mac->ebit = @@ -977,7 +977,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, GST_DEBUG ("CBPY index: %d", cbpy_type_index); if (cbpy_type_index == -1) { GST_ERROR ("CBPY index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } mac->ebit = @@ -1018,7 +1018,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, if (tcoef_type_index == -1) { GST_ERROR ("TCOEF index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } mac->ebit = gst_rtp_h263_pay_move_window_right (context, @@ -1069,7 +1069,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, GST_DEBUG ("MCBPC index: %d", mb_type_index); if (mb_type_index == -1) { GST_ERROR ("MB index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } mac->ebit = gst_rtp_h263_pay_move_window_right (context, mcbpc_P[mb_type_index][2], @@ -1087,7 +1087,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, GST_DEBUG ("CBPY index: %d", cbpy_type_index); if (cbpy_type_index == -1) { GST_ERROR ("CBPY index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } mac->ebit = gst_rtp_h263_pay_move_window_right (context, cbpy_P[cbpy_type_index][2], @@ -1121,7 +1121,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, if (mvd_type == -1) { GST_ERROR ("MVD1-4 index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } //set the MB mvd values mac->mvd[j] = mvd[mvd_type][3]; @@ -1166,7 +1166,7 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, if (tcoef_type_index == -1) { GST_ERROR ("TCOEF index shouldn't be -1 in window: %08x", context->window); - return NULL; + goto beach; } mac->ebit = @@ -1193,6 +1193,10 @@ gst_rtp_h263_pay_B_mbfinder (GstRtpH263PayContext * context, mac->length = mac->end - mac->start + 1; return mac; + +beach: + gst_rtp_h263_pay_mb_destroy (mac); + return NULL; } static GstRtpH263PayMB *