From 9fa3d7a294fdefe33cc0e83fdaea23f90b1f7d66 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 8 May 2008 17:35:44 +0000 Subject: [PATCH] gst/typefind/gsttypefindfunctions.c: Abort the h264 typefinding as soon as _peek() doesn't return anything, which hap... Original commit message from CVS: * gst/typefind/gsttypefindfunctions.c: (h264_video_type_find): Abort the h264 typefinding as soon as _peek() doesn't return anything, which happens for example with files smaller than 128kb. --- ChangeLog | 6 ++++++ gst/typefind/gsttypefindfunctions.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 27af700ecc..8592f51e43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-08 Edward Hervey + + * gst/typefind/gsttypefindfunctions.c: (h264_video_type_find): + Abort the h264 typefinding as soon as _peek() doesn't return anything, + which happens for example with files smaller than 128kb. + 2008-05-08 Wim Taymans Patch by: Wouter Cloetens diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index c8b706a4ca..d1116a4b32 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -1588,6 +1588,9 @@ h264_video_type_find (GstTypeFind * tf, gpointer unused) while (offset < H264_MAX_PROBE_LENGTH) { data = gst_type_find_peek (tf, offset, 4); + if (data == NULL) + goto done; + if (data && IS_MPEG_HEADER (data)) { nut = data[3] & 0x9f; /* forbiden_zero_bit | nal_unit_type */ ref = data[3] & 0x60; /* nal_ref_idc */