[Bug 788119] New: a52dec: missed unref out buffer in error decoding block

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Sep 25 09:44:59 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=788119

            Bug ID: 788119
           Summary: a52dec: missed unref out buffer in error decoding
                    block
    Classification: Platform
           Product: GStreamer
           Version: 1.13.x
                OS: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-ugly
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: p.srinivas at samsung.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Created attachment 360336
  --> https://bugzilla.gnome.org/attachment.cgi?id=360336&action=edit
attached patch

Hi ,

   In gst_a52dec_handle_frame . missed unref out buffer in in error decoding.
   This lead to memory leak.

   code:

   outbuf =
      gst_buffer_new_and_alloc (256 * chans * (SAMPLE_WIDTH / 8) * num_blocks);

  gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
  {
    guint8 *ptr = map.data;
    for (i = 0; i < num_blocks; i++) {
      if (a52_block (a52dec->state)) {
        /* also marks discont */
        GST_AUDIO_DECODER_ERROR (a52dec, 1, STREAM, DECODE, (NULL),
            ("error decoding block %d", i), result);
        if (result != GST_FLOW_OK) {
          gst_buffer_unmap (outbuf, &map);
          goto exit;
        }
      } else {
        gint n, c;
        gint *reorder_map = a52dec->channel_reorder_map;

        for (n = 0; n < 256; n++) {
          for (c = 0; c < chans; c++) {
            ((sample_t *) ptr)[n * chans + reorder_map[c]] =
                a52dec->samples[c * 256 + n];
          }
        }
      }
      ptr += 256 * chans * (SAMPLE_WIDTH / 8);
    }
  }

  sol: gst_buffer_unref (outbuf);

  Please review and share feedback.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list