mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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
This commit is contained in:
parent
41d2b6f19e
commit
6a16be75bf
1 changed files with 3 additions and 5 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue