Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avformat/rtp_av1: Add necessary headers
Date: Tue, 4 Mar 2025 15:36:11 +0100
Message-ID: <AS8P250MB07449D906BAD6DC89037B5808FC82@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)

[-- 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".

                 reply	other threads:[~2025-03-04 14:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8P250MB07449D906BAD6DC89037B5808FC82@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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