* [FFmpeg-devel] [PATCH] avcodec/vc1_parser: Check init_get_bits8()
@ 2024-05-17 20:16 Andreas Rheinhardt
2024-05-18 19:30 ` Michael Niedermayer
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rheinhardt @ 2024-05-17 20:16 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Addresses Coverity issue #1441935.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/vc1_parser: Check init_get_bits8()
2024-05-17 20:16 [FFmpeg-devel] [PATCH] avcodec/vc1_parser: Check init_get_bits8() Andreas Rheinhardt
@ 2024-05-18 19:30 ` Michael Niedermayer
0 siblings, 0 replies; 2+ messages in thread
From: Michael Niedermayer @ 2024-05-18 19:30 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 572 bytes --]
On Fri, May 17, 2024 at 10:16:27PM +0200, Andreas Rheinhardt wrote:
> Addresses Coverity issue #1441935.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> 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
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-18 19:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17 20:16 [FFmpeg-devel] [PATCH] avcodec/vc1_parser: Check init_get_bits8() Andreas Rheinhardt
2024-05-18 19:30 ` Michael Niedermayer
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git