Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 11/17 v2] avformat/evc: don't use an AVIOContext as log context
Date: Mon, 19 Jun 2023 18:11:34 -0300
Message-ID: <20230619211134.20857-1-jamrial@gmail.com> (raw)
In-Reply-To: <20230618234332.1370-1-jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/evc_parse.h | 6 ++++--
 libavformat/evc.c      | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavcodec/evc_parse.h b/libavcodec/evc_parse.h
index a1fbbc643d..6fc19d0868 100644
--- a/libavcodec/evc_parse.h
+++ b/libavcodec/evc_parse.h
@@ -89,7 +89,8 @@ static inline int evc_get_nalu_type(const uint8_t *bits, int bits_size, void *lo
         unsigned char *p = (unsigned char *)bits;
         // forbidden_zero_bit
         if ((p[0] & 0x80) != 0) {
-            av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit header\n");
+            if (logctx) // Don't log without a context
+                av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit header\n");
             return -1;
         }
 
@@ -105,7 +106,8 @@ static inline uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_si
     uint32_t nalu_len = 0;
 
     if (bits_size < EVC_NALU_LENGTH_PREFIX_SIZE) {
-        av_log(logctx, AV_LOG_ERROR, "Can't read NAL unit length\n");
+        if (logctx) // Don't log without a context
+            av_log(logctx, AV_LOG_ERROR, "Can't read NAL unit length\n");
         return 0;
     }
 
diff --git a/libavformat/evc.c b/libavformat/evc.c
index 421ff84cb7..caead88bba 100644
--- a/libavformat/evc.c
+++ b/libavformat/evc.c
@@ -361,7 +361,7 @@ int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data,
     evcc_init(&evcc);
 
     while (bytes_to_read > EVC_NALU_LENGTH_PREFIX_SIZE) {
-        nalu_size = evc_read_nal_unit_length(data, EVC_NALU_LENGTH_PREFIX_SIZE, pb);
+        nalu_size = evc_read_nal_unit_length(data, EVC_NALU_LENGTH_PREFIX_SIZE, NULL);
         if (nalu_size == 0) break;
 
         data += EVC_NALU_LENGTH_PREFIX_SIZE;
@@ -369,7 +369,7 @@ int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data,
 
         if (bytes_to_read < nalu_size) break;
 
-        nalu_type = evc_get_nalu_type(data, bytes_to_read, pb);
+        nalu_type = evc_get_nalu_type(data, bytes_to_read, NULL);
         if (nalu_type < EVC_NOIDR_NUT || nalu_type > EVC_UNSPEC_NUT62) {
             ret = AVERROR_INVALIDDATA;
             goto end;
-- 
2.41.0

_______________________________________________
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:[~2023-06-19 21:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17 15:18 [FFmpeg-devel] [PATCH 1/3] avcodec/evc_frame_merge: use av_fast_realloc() James Almer
2023-06-17 15:18 ` [FFmpeg-devel] [PATCH 2/3] avcodec/evc_frame_merge_bsf: use av_new_packet() James Almer
2023-06-17 15:18 ` [FFmpeg-devel] [PATCH 3/3] fate/lavf-container: add a test to remux raw evc into mp4 James Almer
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 04/10] avcodec/evc_parse: split off Parameter Set parsing into its own file James Almer
2023-06-20  7:37   ` Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics
2023-06-20 11:37     ` James Almer
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 05/10] avcodec/evc_parser: stop exporting delay and gop_size James Almer
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 06/10] avcodec/evc_parse: split off deriving PoC James Almer
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 07/10] avcodec/evc_parser: make ff_evc_parse_nal_unit() local to the parser James Almer
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 08/10] avcodec/evc_parser: remove write only variable James Almer
2023-06-18 12:04   ` Paul B Mahol
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 09/10] avcodec/evc_frame_merge_bsf: make ff_evc_parse_nal_unit() local to the filter James Almer
2023-06-17 22:00 ` [FFmpeg-devel] [PATCH 10/10] avcodec/evc_parse: remove ff_evc_parse_nal_unit() James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 11/17] avformat/evc: don't use an AVIOContext as log context James Almer
2023-06-19 21:11   ` James Almer [this message]
2023-06-20 14:38   ` James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 12/17] avformat/evcdec: deduplicate nalu length and type parsing functions James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 13/17] avformat/evcdec: simplify probe function James Almer
2023-06-19 20:29   ` Michael Niedermayer
2023-06-19 20:42     ` James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 14/17] avformat/evcdec: simplify au_end_found check James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 15/17] avformat/evcdec: don't set AVCodecParameters.framerate James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 16/17] avcodec/evc_ps: make ff_evc_parse_{sps, pps} return an error code James Almer
2023-06-18 23:43 ` [FFmpeg-devel] [PATCH 17/17] avcodec/evc_ps: Check log2_sub_gop_length James Almer
2023-06-19 18:28 ` [FFmpeg-devel] [PATCH 1/3] avcodec/evc_frame_merge: use av_fast_realloc() James Almer

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=20230619211134.20857-1-jamrial@gmail.com \
    --to=jamrial@gmail.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