mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/tiff: do not abort on zero denominator
Fixes decoding valid DNG file.
This commit is contained in:
parent
ee88804d07
commit
4a5ee8c399
|
@ -1241,8 +1241,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||
value = ff_tget(&s->gb, TIFF_LONG, s->le);
|
||||
value2 = ff_tget(&s->gb, TIFF_LONG, s->le);
|
||||
if (!value2) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid denominator in rational\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator in rational\n");
|
||||
value2 = 1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1421,8 +1421,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||
value = ff_tget(&s->gb, TIFF_LONG, s->le);
|
||||
value2 = ff_tget(&s->gb, TIFF_LONG, s->le);
|
||||
if (!value2) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid black level denominator\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
av_log(s->avctx, AV_LOG_WARNING, "Invalid black level denominator\n");
|
||||
value2 = 1;
|
||||
}
|
||||
|
||||
s->black_level = value / value2;
|
||||
|
|
Loading…
Reference in New Issue