[FFmpeg-cvslog] lavf: dont add apic streams for demuxers that dont support it.

Michael Niedermayer git at videolan.org
Tue Sep 25 02:51:38 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Sep 25 02:45:46 2012 +0200| [6bcbe768bbc7ce615e2719fc491dad39af7c8d11] | committer: Michael Niedermayer

lavf: dont add apic streams for demuxers that dont support it.

Fixes crash
Fixes ticket1730

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6bcbe768bbc7ce615e2719fc491dad39af7c8d11
---

 libavformat/utils.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2a8fac1..0eda2ae 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -641,9 +641,13 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
         if ((ret = s->iformat->read_header(s)) < 0)
             goto fail;
 
-    if (id3v2_extra_meta &&
-        (ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)
-        goto fail;
+    if (id3v2_extra_meta) {
+        if (!strcmp(s->iformat->name, "mp3")) {
+            if((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)
+                goto fail;
+        } else
+            av_log(s, AV_LOG_DEBUG, "demuxer does not support additional id3 data, skiping\n");
+    }
     ff_id3v2_free_extra_meta(&id3v2_extra_meta);
 
     avformat_queue_attached_pictures(s);



More information about the ffmpeg-cvslog mailing list