summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2015-03-08 23:27:43 +0100
committerMichael Niedermayer <[email protected]>2015-03-14 14:27:23 +0100
commitd8a8b3948c2996d97958284cb780ead19165da96 (patch)
tree66526f488bd6ae718760743e268ce45b26ac12c1
parent917ce36a2067c3c1a02a54bb0aeb6eff39673dd5 (diff)
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 <[email protected]> (cherry picked from commit d5e9fc782150d4596c72440a0aa02b7f4f1254b1) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/tiff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 998b836e90..a0b1836866 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -636,13 +636,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) {
@@ -934,6 +927,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;
}