mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
decoder: fix unpaired GstBuffer map/unmaps.
This possibly fixes a few memory leaks along the way.
This commit is contained in:
parent
1b500dee54
commit
788d337505
6 changed files with 7 additions and 0 deletions
|
@ -972,5 +972,6 @@ gst_vaapi_decoder_decode_codec_data(GstVaapiDecoder *decoder)
|
||||||
status = klass->decode_codec_data(decoder, buf, buf_size);
|
status = klass->decode_codec_data(decoder, buf, buf_size);
|
||||||
else
|
else
|
||||||
status = GST_VAAPI_DECODER_STATUS_SUCCESS;
|
status = GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||||
|
gst_buffer_unmap(codec_data, &map_info);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2716,6 +2716,7 @@ decode_slice(GstVaapiDecoderH264 *decoder, GstVaapiDecoderUnit *unit)
|
||||||
|
|
||||||
slice = GST_VAAPI_SLICE_NEW(H264, decoder,
|
slice = GST_VAAPI_SLICE_NEW(H264, decoder,
|
||||||
(map_info.data + unit->offset + pi->nalu.offset), pi->nalu.size);
|
(map_info.data + unit->offset + pi->nalu.offset), pi->nalu.size);
|
||||||
|
gst_buffer_unmap(buffer, &map_info);
|
||||||
if (!slice) {
|
if (!slice) {
|
||||||
GST_ERROR("failed to allocate slice");
|
GST_ERROR("failed to allocate slice");
|
||||||
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
|
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
|
||||||
|
|
|
@ -692,6 +692,7 @@ gst_vaapi_decoder_jpeg_decode(GstVaapiDecoder *base_decoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
|
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
|
||||||
|
gst_buffer_unmap(buffer, &map_info);
|
||||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||||
|
|
|
@ -1211,6 +1211,7 @@ decode_slice(GstVaapiDecoderMpeg2 *decoder, GstVaapiDecoderUnit *unit)
|
||||||
|
|
||||||
slice = GST_VAAPI_SLICE_NEW(MPEG2, decoder,
|
slice = GST_VAAPI_SLICE_NEW(MPEG2, decoder,
|
||||||
(map_info.data + unit->offset), unit->size);
|
(map_info.data + unit->offset), unit->size);
|
||||||
|
gst_buffer_unmap(buffer, &map_info);
|
||||||
if (!slice) {
|
if (!slice) {
|
||||||
GST_ERROR("failed to allocate slice");
|
GST_ERROR("failed to allocate slice");
|
||||||
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
|
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
|
||||||
|
@ -1499,6 +1500,7 @@ gst_vaapi_decoder_mpeg2_decode(GstVaapiDecoder *base_decoder,
|
||||||
packet.offset = 4;
|
packet.offset = 4;
|
||||||
|
|
||||||
status = parse_unit(decoder, unit, &packet);
|
status = parse_unit(decoder, unit, &packet);
|
||||||
|
gst_buffer_unmap(buffer, &map_info);
|
||||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
return decode_unit(decoder, unit, &packet);
|
return decode_unit(decoder, unit, &packet);
|
||||||
|
|
|
@ -1097,6 +1097,7 @@ gst_vaapi_decoder_mpeg4_decode(GstVaapiDecoder *base_decoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
|
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
|
||||||
|
gst_buffer_unmap(buffer, &map_info);
|
||||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||||
|
|
|
@ -1267,6 +1267,7 @@ gst_vaapi_decoder_vc1_decode(GstVaapiDecoder *base_decoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
|
status = decode_buffer(decoder, map_info.data + unit->offset, unit->size);
|
||||||
|
gst_buffer_unmap(buffer, &map_info);
|
||||||
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in a new issue