Re: [FFmpeg-devel] [PATCH] avcodec/vc1_parser: Check init_get_bits8()

2024-05-18 Thread Michael Niedermayer
On Fri, May 17, 2024 at 10:16:27PM +0200, Andreas Rheinhardt wrote:
> Addresses Coverity issue #1441935.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/vc1_parser.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

seems i didnt see this one, as i send a patch for this too
anyway your LGTM

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/vc1_parser: Check init_get_bits8()

2024-05-17 Thread Andreas Rheinhardt
Addresses Coverity issue #1441935.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/vc1_parser.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index ec284dca00..a536a7bcf8 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -26,6 +26,7 @@
  */
 
 #include "libavutil/attributes.h"
+#include "libavutil/avassert.h"
 #include "parser.h"
 #include "vc1.h"
 #include "get_bits.h"
@@ -66,7 +67,9 @@ static void vc1_extract_header(AVCodecParserContext *s, 
AVCodecContext *avctx,
 GetBitContext gb;
 int ret;
 vpc->v.s.avctx = avctx;
-init_get_bits8(&gb, buf, buf_size);
+ret = init_get_bits8(&gb, buf, buf_size);
+av_assert1(ret >= 0); // buf_size is bounded by UNESCAPED_THRESHOLD
+
 switch (vpc->prev_start_code) {
 case VC1_CODE_SEQHDR & 0xFF:
 ff_vc1_decode_sequence_header(avctx, &vpc->v, &gb);
-- 
2.40.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".