diff options
author | Edward Hervey <edward@collabora.com> | 2014-05-13 11:23:42 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2014-05-13 11:28:00 +0200 |
commit | 1d01afc166ed4e059575c45be63e7f3d9713a64a (patch) | |
tree | 1f935dd1c49be55cae20eea03106a3cddc690154 /gst | |
parent | 6baeb94dce8731cdb91e56dff79a41d947caa61a (diff) |
jp2kdecimator: Don't leak various slices and arrays
Diffstat (limited to 'gst')
-rw-r--r-- | gst/jp2kdecimator/jp2kcodestream.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gst/jp2kdecimator/jp2kcodestream.c b/gst/jp2kdecimator/jp2kcodestream.c index d4f5451ce..943d83734 100644 --- a/gst/jp2kdecimator/jp2kcodestream.c +++ b/gst/jp2kdecimator/jp2kcodestream.c @@ -887,6 +887,7 @@ parse_packet (GstJP2kDecimator * self, GstByteReader * reader, if (!gst_byte_reader_peek_uint16_be (reader, &marker)) { GST_ERROR_OBJECT (self, "Truncated file"); ret = GST_FLOW_ERROR; + g_slice_free (Packet, p); goto done; } @@ -898,12 +899,14 @@ parse_packet (GstJP2kDecimator * self, GstByteReader * reader, if (!gst_byte_reader_get_uint16_be (reader, &dummy)) { GST_ERROR_OBJECT (self, "Truncated file"); ret = GST_FLOW_ERROR; + g_slice_free (Packet, p); goto done; } if (!gst_byte_reader_get_uint16_be (reader, &seqno)) { GST_ERROR_OBJECT (self, "Truncated file"); ret = GST_FLOW_ERROR; + g_slice_free (Packet, p); goto done; } p->data = gst_byte_reader_peek_data_unchecked (reader); @@ -1169,8 +1172,10 @@ parse_tile (GstJP2kDecimator * self, GstByteReader * reader, PacketLengthTilePart *plt = g_slice_new (PacketLengthTilePart); ret = parse_plt (self, reader, plt, length); - if (ret != GST_FLOW_OK) + if (ret != GST_FLOW_OK) { + g_slice_free (PacketLengthTilePart, plt); goto done; + } tile->plt = g_list_append (tile->plt, plt); break; @@ -1787,6 +1792,8 @@ decimate_main_header (GstJP2kDecimator * self, MainHeader * header) if (l == NULL) { GST_ERROR_OBJECT (self, "Not enough packets"); ret = GST_FLOW_ERROR; + g_array_free (plt->packet_lengths, TRUE); + g_slice_free (PacketLengthTilePart, plt); goto done; } |