diff mbox series

[FFmpeg-devel,1/7] avcodec/pgxdec: Make better use of size check

Message ID AS8PR01MB79440FF78671075B4A5A8C988FF99@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit a7e8b0f360d0a7c84604e38759b24fa54e3349c7
Headers show
Series [FFmpeg-devel,1/7] avcodec/pgxdec: Make better use of size check | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 24, 2022, 4:39 a.m. UTC
Each of the three calls to pgx_get_number() consumes at least two bytes.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/pgxdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Paul B Mahol April 24, 2022, 11:18 a.m. UTC | #1
lgtm if tested
diff mbox series

Patch

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);