[FFmpeg-devel] [PATCH]Print a warning if the invalid tiff tag type 0 is found in an exif tag

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Jul 22 17:43:07 CEST 2014


Hi!

FFmpeg currently requests a sample if an exif tag with tag type 0 is found.
Attached patch prints a warning instead, fixes ticket #3792.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/exif.c b/libavcodec/exif.c
index a980da2..fa30f05 100644
--- a/libavcodec/exif.c
+++ b/libavcodec/exif.c
@@ -47,6 +47,11 @@ static int exif_add_metadata(AVCodecContext *avctx, int count, int type,
                              AVDictionary **metadata)
 {
     switch(type) {
+    case 0:
+        av_log(avctx, AV_LOG_WARNING,
+               "Invalid TIFF tag type 0 found for %s with size %d\n",
+               name, count);
+        return 0;
     case TIFF_DOUBLE   : return ff_tadd_doubles_metadata(count, name, sep, gb, le, metadata);
     case TIFF_SSHORT   : return ff_tadd_shorts_metadata(count, name, sep, gb, le, 1, metadata);
     case TIFF_SHORT    : return ff_tadd_shorts_metadata(count, name, sep, gb, le, 0, metadata);


More information about the ffmpeg-devel mailing list