Browse Source

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 d5e9fc7821)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.8
Michael Niedermayer 11 years ago
parent
commit
6a671797d7
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      libavcodec/tiff.c

+ 7
- 7
libavcodec/tiff.c View File

@@ -844,13 +844,6 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
s->bpp = -1; 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; break;
case TIFF_SAMPLES_PER_PIXEL: case TIFF_SAMPLES_PER_PIXEL:
if (count != 1) { if (count != 1) {
@@ -1163,6 +1156,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
} }
} }
end: 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); bytestream2_seek(&s->gb, start, SEEK_SET);
return 0; return 0;
} }


Loading…
Cancel
Save