[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libextractor] 16/27: handle allocation failure in gstreame
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libextractor] 16/27: handle allocation failure in gstreamer plugin |
Date: |
Sun, 15 Oct 2017 21:34:40 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libextractor.
commit 85daaa3242c01d9c116626fbe90bcc5ea5a2e4d0
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 15 20:35:05 2017 +0200
handle allocation failure in gstreamer plugin
---
src/plugins/gstreamer_extractor.c | 41 ++++++++++++++++++++++++++-------------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/src/plugins/gstreamer_extractor.c
b/src/plugins/gstreamer_extractor.c
index 2f47adf0..31568a72 100644
--- a/src/plugins/gstreamer_extractor.c
+++ b/src/plugins/gstreamer_extractor.c
@@ -1038,17 +1038,23 @@ send_structure_foreach (GQuark field_id,
switch (ps->st)
{
case STREAM_TYPE_AUDIO:
+ if (NULL == audio_quarks)
+ return FALSE;
for (quark = audio_quarks; *quark != 0; quark++)
if (*quark == field_id)
return TRUE;
break;
case STREAM_TYPE_VIDEO:
case STREAM_TYPE_IMAGE:
+ if (NULL == video_quarks)
+ return FALSE;
for (quark = video_quarks; *quark != 0; quark++)
if (*quark == field_id)
return TRUE;
break;
case STREAM_TYPE_SUBTITLE:
+ if (NULL == subtitle_quarks)
+ return FALSE;
for (quark = subtitle_quarks; *quark != 0; quark++)
if (*quark == field_id)
return TRUE;
@@ -2216,22 +2222,29 @@ gstreamer_init ()
0, "GStreamer-based libextractor plugin");
audio_quarks = g_new0 (GQuark, 4);
- audio_quarks[0] = g_quark_from_string ("rate");
- audio_quarks[1] = g_quark_from_string ("channels");
- audio_quarks[2] = g_quark_from_string ("depth");
- audio_quarks[3] = g_quark_from_string (NULL);
-
+ if (NULL != audio_quarks)
+ {
+ audio_quarks[0] = g_quark_from_string ("rate");
+ audio_quarks[1] = g_quark_from_string ("channels");
+ audio_quarks[2] = g_quark_from_string ("depth");
+ audio_quarks[3] = g_quark_from_string (NULL);
+ }
video_quarks = g_new0 (GQuark, 6);
- video_quarks[0] = g_quark_from_string ("width");
- video_quarks[1] = g_quark_from_string ("height");
- video_quarks[2] = g_quark_from_string ("framerate");
- video_quarks[3] = g_quark_from_string ("max-framerate");
- video_quarks[4] = g_quark_from_string ("pixel-aspect-ratio");
- video_quarks[5] = g_quark_from_string (NULL);
-
+ if (NULL != video_quarks)
+ {
+ video_quarks[0] = g_quark_from_string ("width");
+ video_quarks[1] = g_quark_from_string ("height");
+ video_quarks[2] = g_quark_from_string ("framerate");
+ video_quarks[3] = g_quark_from_string ("max-framerate");
+ video_quarks[4] = g_quark_from_string ("pixel-aspect-ratio");
+ video_quarks[5] = g_quark_from_string (NULL);
+ }
subtitle_quarks = g_new0 (GQuark, 2);
- subtitle_quarks[0] = g_quark_from_string ("language-code");
- subtitle_quarks[1] = g_quark_from_string (NULL);
+ if (NULL != subtitle_quarks)
+ {
+ subtitle_quarks[0] = g_quark_from_string ("language-code");
+ subtitle_quarks[1] = g_quark_from_string (NULL);
+ }
duration_quark = g_quark_from_string ("duration");
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libextractor] branch master updated (d0a7ceb6 -> e340cef5), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 01/27: indentation fixes, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 04/27: indentation fixes, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 02/27: fix potential assign-after-free, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 08/27: fix potential buffer underflow read in deb_extractor, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 05/27: defensive programming: avoid malloc(0) in deb extractor, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 03/27: avoid passing of char to isspace()-family of functions, always pass unsigned chars, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 09/27: fix very hypothetical lack of 0-termination in ole2-extractor iff translation string was more than 10x as long as the English version, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 16/27: handle allocation failure in gstreamer plugin,
gnunet <=
- [GNUnet-SVN] [libextractor] 11/27: be more conservative about result from ctime_r, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 14/27: add missing continue if max meta data was reached to avoid use after free, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 15/27: fix indentation, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 06/27: fix duration initialization in ffmpeg extractor (badly positioned #if), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 13/27: seems some specs of c_time allow up to 71 bytes, so increase buffer size just to be safe, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 19/27: need isspace, not isblank for rpm extractor, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 17/27: handle allocation failure in PDF fdopen call, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 18/27: do not try to seek on SHM if we do not use SHM, even if (bad) plugin requests it, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 10/27: be more careful with memory allocation failures in gsf extractor, avoid calling g_free(NULL), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 20/27: fix signed/unsigned comparison issue, gnunet, 2017/10/15