aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-08 23:27:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-21 01:52:52 +0100
commitc5b2ef3bdf23d16ded3e3aaa66763963e130259d (patch)
tree84dedf0a022fed766f20773cf5fe853a371c425c
parent07df052d8d92405ce0c89f9e3389aeefb5026be5 (diff)
downloadffmpeg-c5b2ef3bdf23d16ded3e3aaa66763963e130259d.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) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/tiff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index ee16d7805d..b00bc1c217 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -839,13 +839,6 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
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) {
@@ -1158,6 +1151,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
}
end:
+ 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;
}