summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-19 20:57:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-19 21:09:07 +0200
commit6ea69a8ffaeabf1a8bfd0c7db1019ca5ac082c99 (patch)
treea5a2421b2204df8dc11d19b35f001799fc706369 /libavcodec/tiff.c
parent66d02d3ca626664b7cdaf9b21a44b130959c6c24 (diff)
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 <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 73bf828a84..61387e7320 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;