diff mbox series

[FFmpeg-devel,3/7] avcodec/pgxdec: Remove pointless checks

Message ID AS8PR01MB79441EAB2E52898C305280F58FF99@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit 67f796050519a3a3f1d52c6b054d3c80b8980cd2
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:42 a.m. UTC
These checks were (most likely) added to check for overreads
as the bytestream2_get_* functions return 0 in this case.
Yet this is not necessary anymore as we now have an explicit check
for the size. Should the input contain a real \0, pgx_get_number()
will error out lateron.

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

Comments

Paul B Mahol April 24, 2022, 11:17 a.m. UTC | #1
probably fine
diff mbox series

Patch

diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
index 9c474036da..c9ada5afb5 100644
--- a/libavcodec/pgxdec.c
+++ b/libavcodec/pgxdec.c
@@ -69,14 +69,11 @@  static int pgx_decode_header(AVCodecContext *avctx, GetByteContext *g,
     } else if (byte == '-') {
         *sign = 1;
         bytestream2_skipu(g, 1);
-    } else if (byte == 0)
-        goto error;
+    }
 
     byte = bytestream2_peek_byteu(g);
     if (byte == ' ')
         bytestream2_skipu(g, 1);
-    else if (byte == 0)
-        goto error;
 
     if (pgx_get_number(avctx, g, depth))
         goto error;