aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-08 23:27:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-29 03:34:22 +0200
commit6a671797d769201e79cd1e8fb666c2a67e34a6dd (patch)
treebb4b49c664adab125c00506d37e03c816bf96ccf /libavcodec/tiff.c
parent23666f0e229e28cfa1909c766d653a5ad023579a (diff)
downloadffmpeg-6a671797d769201e79cd1e8fb666c2a67e34a6dd.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>
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 eb2a9630da..9434794185 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -844,13 +844,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) {
@@ -1163,6 +1156,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;
}