X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fqpeg.c;h=d4195c5f0b7f145e7bbbf28dc894c8e0bed4b9ab;hb=fda424b300c1a0b991296aa585691609d01196bd;hp=654fd998d6abb11efaa7546ca3f7518dfe6b5dd0;hpb=493240a522fca34882601fbeeda4e17aa40a0303;p=ffmpeg diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 654fd998d6a..d4195c5f0b7 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -99,6 +99,8 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst, } } } else { + if (bytestream2_get_bytes_left(&qctx->buffer) < copy) + copy = bytestream2_get_bytes_left(&qctx->buffer); for(i = 0; i < copy; i++) { dst[filled++] = bytestream2_get_byte(&qctx->buffer); if (filled >= width) {