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
... | ... |
@@ -755,13 +755,6 @@ static int tiff_decode_tag(TiffContext *s) |
755 | 755 |
s->bpp = -1; |
756 | 756 |
} |
757 | 757 |
} |
758 |
- if (s->bpp > 64U) { |
|
759 |
- av_log(s->avctx, AV_LOG_ERROR, |
|
760 |
- "This format is not supported (bpp=%d, %d components)\n", |
|
761 |
- s->bpp, count); |
|
762 |
- s->bpp = 0; |
|
763 |
- return AVERROR_INVALIDDATA; |
|
764 |
- } |
|
765 | 758 |
break; |
766 | 759 |
case TIFF_SAMPLES_PER_PIXEL: |
767 | 760 |
if (count != 1) { |
... | ... |
@@ -1037,6 +1030,13 @@ static int tiff_decode_tag(TiffContext *s) |
1037 | 1037 |
av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n", |
1038 | 1038 |
tag, tag); |
1039 | 1039 |
} |
1040 |
+ if (s->bpp > 64U) { |
|
1041 |
+ av_log(s->avctx, AV_LOG_ERROR, |
|
1042 |
+ "This format is not supported (bpp=%d, %d components)\n", |
|
1043 |
+ s->bpp, count); |
|
1044 |
+ s->bpp = 0; |
|
1045 |
+ return AVERROR_INVALIDDATA; |
|
1046 |
+ } |
|
1040 | 1047 |
bytestream2_seek(&s->gb, start, SEEK_SET); |
1041 | 1048 |
return 0; |
1042 | 1049 |
} |