avcodec/pgxdec: Make better use of size check

Each of the three calls to pgx_get_number() consumes at least two bytes.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/5.1
Andreas Rheinhardt 3 years ago
parent 14b74610d7
commit a7e8b0f360
  1. 3
      libavcodec/pgxdec.c

@ -56,9 +56,8 @@ static int pgx_decode_header(AVCodecContext *avctx, GetByteContext *g,
{
int byte;
if (bytestream2_get_bytes_left(g) < 6) {
if (bytestream2_get_bytes_left(g) < 12)
return AVERROR_INVALIDDATA;
}
bytestream2_skip(g, 6);

Loading…
Cancel
Save