[FFmpeg-devel] [PATCH]Default to 1bpp when decoding tiff

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Aug 31 10:52:14 CEST 2012


Hi!

TIFF Tag BitsPerSample has a default value of 1, the only value of bppcount 
that FFmpeg supports for bpp==1 is 1, so initialize both values to 1.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 26401b1..1b88de0 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1005,6 +1005,8 @@ static int decode_frame(AVCodecContext *avctx,
         return -1;
     }
     s->le = le;
+    // TIFF_BPP is not a required tag and defaults to 1
+    s->bppcount = s->bpp = 1;
     s->invert = 0;
     s->compr = TIFF_RAW;
     s->fill_order = 0;


More information about the ffmpeg-devel mailing list