[FFmpeg-devel] [PATCH] oggparseskeleton: Fix fisbone header parsing

James Almer jamrial at gmail.com
Sat Jul 6 09:34:13 CEST 2013


Remove the first packet size check. The Skeleton EOS page contains a single packet of length
zero.

start_granule should be applied to the stream referenced in the fisbone packet, not to the
Skeleton stream.
This was broken in d1f05dd18375f2f8e68372edee11436927e43ba8 and produced bogus warnings about 
multiple fisbone in the same stream on files with more than one stream.
Also replace avpriv_report_missing_feature() with a normal av_log() call, since there should
not be more than one fisbone for a given stream.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/oggparseskeleton.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavformat/oggparseskeleton.c b/libavformat/oggparseskeleton.c
index 307387d..56f5713 100644
--- a/libavformat/oggparseskeleton.c
+++ b/libavformat/oggparseskeleton.c
@@ -37,9 +37,6 @@ static int skeleton_header(AVFormatContext *s, int idx)
     strcpy(st->codec->codec_name, "skeleton");
     st->codec->codec_type = AVMEDIA_TYPE_DATA;
 
-    if (os->psize < 8)
-        return -1;
-
     if (!strncmp(buf, "fishead", 8)) {
         if (os->psize < 64)
             return -1;
@@ -74,12 +71,16 @@ static int skeleton_header(AVFormatContext *s, int idx)
 
         target_idx = ogg_find_stream(ogg, AV_RL32(buf+12));
         start_granule = AV_RL64(buf+36);
+        if (target_idx < 0) {
+            av_log(s, AV_LOG_WARNING, "Serial number in fisbone doesn't match any stream\n");
+            return 1;
+        }
+        os = ogg->streams + target_idx;
         if (os->start_granule != OGG_NOGRANULE_VALUE) {
-            avpriv_report_missing_feature(s,
-                                          "Multiple fisbone for the same stream");
+            av_log(s, AV_LOG_WARNING, "Multiple fisbone for the same stream\n");
             return 1;
         }
-        if (target_idx >= 0 && start_granule != OGG_NOGRANULE_VALUE) {
+        if (start_granule != OGG_NOGRANULE_VALUE) {
             os->start_granule = start_granule;
         }
     }
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list