ffmpeg | branch: master | Michael Niedermayer <[email protected]> | Tue Aug 19 
20:57:42 2014 +0200| [6ea69a8ffaeabf1a8bfd0c7db1019ca5ac082c99] | committer: 
Michael Niedermayer

avcodec/tiff: do not use photometric to detect pix_fmt

They should match but they do not always
Fixes assertion failure
no testcase with unmodified source available

Signed-off-by: Michael Niedermayer <[email protected]>

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

 libavcodec/tiff.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 73bf828..61387e7 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -419,7 +419,8 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, 
uint8_t *dst, int strid
     int c, line, pixels, code, ret;
     const uint8_t *ssrc = src;
     int width = ((s->width * s->bpp) + 7) >> 3;
-    int is_yuv = s->photometric == TIFF_PHOTOMETRIC_YCBCR;
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(p->format);
+    int is_yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components 
>= 2;
 
     if (s->planar)
         width /= s->bppcount;

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to