* [FFmpeg-devel] [PATCH] avformat/rtp_av1: Add necessary headers
@ 2025-03-04 14:36 Andreas Rheinhardt
0 siblings, 0 replies; only message in thread
From: Andreas Rheinhardt @ 2025-03-04 14:36 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1: Type: text/plain, Size: 79 bytes --]
Patch attached. Will apply it tomorrow unless there are objections.
- Andreas
[-- Attachment #2: 0001-avformat-rtp_av1-Add-necessary-headers.patch --]
[-- Type: text/x-patch, Size: 2816 bytes --]
From 9e2773034ba177861e32b746b5dbd8d0370661a5 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Tue, 4 Mar 2025 15:34:38 +0100
Subject: [PATCH] avformat/rtp_av1: Add necessary headers
Also use a void* instead of an AVFormatContext as logctx in parse_leb.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavformat/rtp_av1.h | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/libavformat/rtp_av1.h b/libavformat/rtp_av1.h
index a353fc0e4e..29ac81f844 100644
--- a/libavformat/rtp_av1.h
+++ b/libavformat/rtp_av1.h
@@ -29,6 +29,10 @@
#ifndef AVFORMAT_RTP_AV1_H
#define AVFORMAT_RTP_AV1_H
+#include <stdint.h>
+
+#include "libavutil/log.h"
+
// define a couple of flags and bit fields
#define AV1B_OBU_FORBIDDEN 7
#define AV1F_OBU_FORBIDDEN (1u << AV1B_OBU_FORBIDDEN)
@@ -88,7 +92,7 @@ static inline void write_leb_n(uint8_t *lebptr, uint32_t length, unsigned int nu
}
/// securely parse LEB bytes and return the resulting encoded length
-static inline unsigned int parse_leb(AVFormatContext *ctx, const uint8_t *buf_ptr,
+static inline unsigned int parse_leb(void *logctx, const uint8_t *buf_ptr,
uint32_t buffer_size, uint32_t *obu_size) {
uint8_t leb128;
unsigned int num_lebs = 0;
@@ -96,7 +100,7 @@ static inline unsigned int parse_leb(AVFormatContext *ctx, const uint8_t *buf_pt
do {
uint32_t leb7;
if (!buffer_size) {
- av_log(ctx, AV_LOG_ERROR, "AV1: Out of data in OBU size field AV1 RTP packet\n");
+ av_log(logctx, AV_LOG_ERROR, "AV1: Out of data in OBU size field AV1 RTP packet\n");
return 0;
}
leb128 = *buf_ptr++;
@@ -107,13 +111,13 @@ static inline unsigned int parse_leb(AVFormatContext *ctx, const uint8_t *buf_pt
* of violation here. It is legal, though, to have the most significant
* bytes with all zero bits (in the lower 7 bits). */
if (((num_lebs == 4) && (leb7 >= 0x10)) || ((num_lebs > 4) && leb7)) {
- av_log(ctx, AV_LOG_ERROR, "AV1: OBU size field exceeds 32 bit in AV1 RTP packet\n");
+ av_log(logctx, AV_LOG_ERROR, "AV1: OBU size field exceeds 32 bit in AV1 RTP packet\n");
return 0;
}
if ((num_lebs == 7) && (leb128 >= 0x80)) {
/* leb128 is defined to be up to 8 bytes (why???), 8th byte MUST NOT
* indicate continuation */
- av_log(ctx, AV_LOG_ERROR, "AV1: OBU size field consists of too many bytes in AV1 RTP packet\n");
+ av_log(logctx, AV_LOG_ERROR, "AV1: OBU size field consists of too many bytes in AV1 RTP packet\n");
return 0;
}
// shifts >= 32 are undefined in C!
--
2.45.2
[-- Attachment #3: 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] only message in thread
only message in thread, other threads:[~2025-03-04 14:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-04 14:36 [FFmpeg-devel] [PATCH] avformat/rtp_av1: Add necessary headers Andreas Rheinhardt
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