X-Git-Url: https://git.libav.org/?p=libav.git;a=blobdiff_plain;f=libavformat%2Fflvdec.c;h=81a71d39f4cb9ec56f34d24233a73d6f2f17dd41;hp=1b29740f41b1113d2baa5b1197b0112c44101633;hb=585dc1aecef0371ad6f16cb3750ae2a6da9cf00a;hpb=e12f1cd616573795681ce939113ac6cdad4c1f2b diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 1b29740f41..81a71d39f4 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -801,7 +801,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) type, size, flags); skip: - avio_seek(s->pb, next, SEEK_SET); + if (avio_seek(s->pb, next, SEEK_SET) != next) { + // This can happen if flv_read_metabody above read past + // next, on a non-seekable input, and the preceding data has + // been flushed out from the IO buffer. + av_log(s, AV_LOG_ERROR, "Unable to seek to the next packet\n"); + return AVERROR_INVALIDDATA; + } continue; }