mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-10 10:04:23 +00:00
audio, video: init audio/video format info to UNKNOWN format
This is to prevent e.g. GST_AUDIO_INFO_FORMAT() from crashing on a NULL pointer dereference when used with an unset info.
This commit is contained in:
parent
01854cca80
commit
372cf41a6d
2 changed files with 5 additions and 0 deletions
|
@ -275,6 +275,8 @@ gst_audio_info_init (GstAudioInfo * info)
|
|||
g_return_if_fail (info != NULL);
|
||||
|
||||
memset (info, 0, sizeof (GstAudioInfo));
|
||||
|
||||
info->finfo = &formats[GST_AUDIO_FORMAT_UNKNOWN];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -608,6 +608,9 @@ gst_video_info_init (GstVideoInfo * info)
|
|||
g_return_if_fail (info != NULL);
|
||||
|
||||
memset (info, 0, sizeof (GstVideoInfo));
|
||||
|
||||
info->finfo = &formats[GST_VIDEO_FORMAT_UNKNOWN].info;
|
||||
|
||||
info->views = 1;
|
||||
/* arrange for sensible defaults, e.g. if turned into caps */
|
||||
info->fps_n = 0;
|
||||
|
|
Loading…
Reference in a new issue