diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-08 23:27:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-13 17:06:09 +0100 |
commit | 676dff8c546274a8b5ab93038acca7fc0c347405 (patch) | |
tree | 8cbeca0d8a3e74ef1c5cea9341f350e2449b7f7f | |
parent | 95d6bd95b1296128b2750151924790b148cb20c8 (diff) | |
download | ffmpeg-676dff8c546274a8b5ab93038acca7fc0c347405.tar.gz |
avcodec/tiff: move bpp check to after "end:"
This ensures that all current and future code-pathes get bpp checked
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d5e9fc782150d4596c72440a0aa02b7f4f1254b1)
Conflicts:
libavcodec/tiff.c
-rw-r--r-- | libavcodec/tiff.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 239750d3d6..7278afbf86 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -755,13 +755,6 @@ static int tiff_decode_tag(TiffContext *s) s->bpp = -1; } } - if (s->bpp > 64U) { - av_log(s->avctx, AV_LOG_ERROR, - "This format is not supported (bpp=%d, %d components)\n", - s->bpp, count); - s->bpp = 0; - return AVERROR_INVALIDDATA; - } break; case TIFF_SAMPLES_PER_PIXEL: if (count != 1) { @@ -1037,6 +1030,13 @@ static int tiff_decode_tag(TiffContext *s) av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n", tag, tag); } + if (s->bpp > 64U) { + av_log(s->avctx, AV_LOG_ERROR, + "This format is not supported (bpp=%d, %d components)\n", + s->bpp, count); + s->bpp = 0; + return AVERROR_INVALIDDATA; + } bytestream2_seek(&s->gb, start, SEEK_SET); return 0; } |