Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-09 01:27:43 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-03-09 01:36:46 +0300
commitd5e9fc782150d4596c72440a0aa02b7f4f1254b1 (patch)
tree1c527f25d60661b0704be8a60f2088522c6b39e4 /libavcodec/tiff.c
parent9889762a9bdbb80efb79053ffb6f8fb9ecb4a5f8 (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 <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index fe45cac743..7a7f9b748d 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -847,13 +847,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) {
@@ -1166,6 +1159,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;
}