X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Ffilmstripdec.c;h=b76d4b7e1d6eed2e4988d120dff24f1fd7447235;hp=abc5f668e8a47f6d073c164834351723bc0a9283;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/filmstripdec.c b/ffmpeg/libavformat/filmstripdec.c index abc5f66..b76d4b7 100644 --- a/ffmpeg/libavformat/filmstripdec.c +++ b/ffmpeg/libavformat/filmstripdec.c @@ -67,6 +67,12 @@ static int read_header(AVFormatContext *s) st->codec->width = avio_rb16(pb); st->codec->height = avio_rb16(pb); film->leading = avio_rb16(pb); + + if (st->codec->width * 4LL * st->codec->height >= INT_MAX) { + av_log(s, AV_LOG_ERROR, "dimensions too large\n"); + return AVERROR_PATCHWELCOME; + } + avpriv_set_pts_info(st, 64, 1, avio_rb16(pb)); avio_seek(pb, 0, SEEK_SET); @@ -82,9 +88,9 @@ static int read_packet(AVFormatContext *s, if (avio_feof(s->pb)) return AVERROR(EIO); - pkt->dts = avio_tell(s->pb) / (st->codec->width * (st->codec->height + film->leading) * 4); + pkt->dts = avio_tell(s->pb) / (st->codec->width * (int64_t)(st->codec->height + film->leading) * 4); pkt->size = av_get_packet(s->pb, pkt, st->codec->width * st->codec->height * 4); - avio_skip(s->pb, st->codec->width * film->leading * 4); + avio_skip(s->pb, st->codec->width * (int64_t) film->leading * 4); if (pkt->size < 0) return pkt->size; pkt->flags |= AV_PKT_FLAG_KEY;