Commit 70db2103 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

vp8enc: Ensure that we always have valid frame user data before using it

Otherwise we're going to dereference NULL pointers.
parent 7eee775d
......@@ -289,7 +289,14 @@ gst_vp8_enc_process_frame_user_data (GstVPXEnc * enc,
GstVideoCodecFrame * frame)
GstVP8EncUserData *user_data;
user_data = gst_video_codec_frame_get_user_data (frame);
if (!user_data) {
GST_ERROR_OBJECT (enc, "Have no frame user data");
return NULL;
if (user_data->image)
g_slice_free (vpx_image_t, user_data->image);
user_data->image = NULL;
......@@ -301,7 +308,14 @@ gst_vp8_enc_handle_invisible_frame_buffer (GstVPXEnc * enc, void *user_data,
GstBuffer * buffer)
GstVP8EncUserData *vp8_user_data = (GstVP8EncUserData *) user_data;
if (!vp8_user_data) {
GST_ERROR_OBJECT (enc, "Have no frame user data");
vp8_user_data->invisible = g_list_append (vp8_user_data->invisible, buffer);
return GST_FLOW_OK;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment