summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-03-20 11:26:38 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-04-10 14:58:17 +0200
commit788d337505da430eac6afe435b657d0260d8cc18 (patch)
treebc469cb4d4c12394a7af0fe437b09e4b58ee560c /gst-libs
parent1b500dee54795254e1e3616f90329c0e5da1f95a (diff)
decoder: fix unpaired GstBuffer map/unmaps.
This possibly fixes a few memory leaks along the way.
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder.c1
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_h264.c1
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c1
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c2
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c1
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_vc1.c1
6 files changed, 7 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c
index 77fe1199..3225b9f3 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder.c
@@ -972,5 +972,6 @@ gst_vaapi_decoder_decode_codec_data(GstVaapiDecoder *decoder)
status = klass->decode_codec_data(decoder, buf, buf_size);
else
status = GST_VAAPI_DECODER_STATUS_SUCCESS;
+ gst_buffer_unmap(codec_data, &map_info);
return status;
}
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
index 6b690824..aa61aeb4 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
@@ -2716,6 +2716,7 @@ decode_slice(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit)
slice = GST_VAAPI_SLICE_NEW(H264, decoder,
(map_info.data + unit->offset + pi->nalu.offset), pi->nalu.size);
+ gst_buffer_unmap(buffer, &map_info);
if (!slice) {
GST_ERROR("failed to allocate slice");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c
index ba77436a..bb50e220 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_jpeg.c
@@ -692,6 +692,7 @@ gst_vaapi_decoder_jpeg_decode(GstVaapiDecoder *base_decoder,
}
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
+ gst_buffer_unmap(buffer, &map_info);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return status;
return GST_VAAPI_DECODER_STATUS_SUCCESS;
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c
index 5c857e1f..b3202485 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c
@@ -1211,6 +1211,7 @@ decode_slice(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit)
slice = GST_VAAPI_SLICE_NEW(MPEG2, decoder,
(map_info.data + unit->offset), unit->size);
+ gst_buffer_unmap(buffer, &map_info);
if (!slice) {
GST_ERROR("failed to allocate slice");
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
@@ -1499,6 +1500,7 @@ gst_vaapi_decoder_mpeg2_decode(GstVaapiDecoder *base_decoder,
packet.offset = 4;
status = parse_unit(decoder, unit, &packet);
+ gst_buffer_unmap(buffer, &map_info);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return status;
return decode_unit(decoder, unit, &packet);
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
index d2a0b365..b7b6e0bc 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
@@ -1097,6 +1097,7 @@ gst_vaapi_decoder_mpeg4_decode(GstVaapiDecoder *base_decoder,
}
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
+ gst_buffer_unmap(buffer, &map_info);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return status;
return GST_VAAPI_DECODER_STATUS_SUCCESS;
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c
index e063cd26..6eb701b6 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c
@@ -1267,6 +1267,7 @@ gst_vaapi_decoder_vc1_decode(GstVaapiDecoder *base_decoder,
}
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
+ gst_buffer_unmap(buffer, &map_info);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return status;
return GST_VAAPI_DECODER_STATUS_SUCCESS;