mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
v4l2codecs: vp9: Add missing error checks in decide_allocation
This could otherwise lead to crash. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1402>
This commit is contained in:
parent
eb33309050
commit
8a1440b3f1
1 changed files with 13 additions and 0 deletions
|
@ -573,8 +573,21 @@ gst_v4l2_codec_vp9_dec_decide_allocation (GstVideoDecoder * decoder,
|
|||
|
||||
self->sink_allocator = gst_v4l2_codec_allocator_new (self->decoder,
|
||||
GST_PAD_SINK, num_bitstream);
|
||||
if (!self->sink_allocator) {
|
||||
GST_ELEMENT_ERROR (self, RESOURCE, NO_SPACE_LEFT,
|
||||
("Not enough memory to allocate sink buffers."), (NULL));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
self->src_allocator = gst_v4l2_codec_allocator_new (self->decoder,
|
||||
GST_PAD_SRC, GST_VP9_REF_FRAMES + min + 4);
|
||||
if (!self->src_allocator) {
|
||||
GST_ELEMENT_ERROR (self, RESOURCE, NO_SPACE_LEFT,
|
||||
("Not enough memory to allocate source buffers."), (NULL));
|
||||
g_clear_object (&self->sink_allocator);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
self->src_pool = gst_v4l2_codec_pool_new (self->src_allocator, &self->vinfo);
|
||||
|
||||
/* Our buffer pool is internal, we will let the base class create a video
|
||||
|
|
Loading…
Reference in a new issue