[FFmpeg-cvslog] avcodec/pgxdec: Make better use of size check
Andreas Rheinhardt
git at videolan.org
Thu Apr 28 02:56:54 EEST 2022
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Apr 15 11:53:07 2022 +0200| [a7e8b0f360d0a7c84604e38759b24fa54e3349c7] | committer: Andreas Rheinhardt
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 at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7e8b0f360d0a7c84604e38759b24fa54e3349c7
---
libavcodec/pgxdec.c | 3 +--
1 file changed, 1 insertion(+), 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);
More information about the ffmpeg-cvslog
mailing list