[FFmpeg-cvslog] avcodec/pgxdec: Remove pointless checks

Andreas Rheinhardt git at videolan.org
Thu Apr 28 02:56:58 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Apr 15 14:11:19 2022 +0200| [67f796050519a3a3f1d52c6b054d3c80b8980cd2] | committer: Andreas Rheinhardt

avcodec/pgxdec: Remove pointless checks

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.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67f796050519a3a3f1d52c6b054d3c80b8980cd2
---

 libavcodec/pgxdec.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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;



More information about the ffmpeg-cvslog mailing list