aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pgxdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-04-15 11:53:07 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-04-28 01:18:04 +0200
commita7e8b0f360d0a7c84604e38759b24fa54e3349c7 (patch)
treed90e232cf7cdf84e2a2e535e11f261a00e481e17 /libavcodec/pgxdec.c
parent14b74610d7e6e471801fe755aa0840c9f2d4ecb4 (diff)
downloadffmpeg-a7e8b0f360d0a7c84604e38759b24fa54e3349c7.tar.gz
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>
Diffstat (limited to 'libavcodec/pgxdec.c')
-rw-r--r--libavcodec/pgxdec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
index 899e7a9994..154a683b4f 100644
--- a/libavcodec/pgxdec.c
+++ b/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);