diff mbox series

[FFmpeg-devel] avformat/adtsenc: do not pass NULL to av_log()

Message ID CAPYw7P6J2FqRD638JxPPGrsd+ssK5C9OgJ8qLYJ5YhMtbHz10g@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] avformat/adtsenc: do not pass NULL to av_log() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Paul B Mahol April 27, 2023, 8:37 a.m. UTC
Patch  attached.
diff mbox series

Patch

From 4d990d87cc4df0593abeec8e398556089f1a7c0c Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Thu, 27 Apr 2023 10:35:33 +0200
Subject: [PATCH] avformat/adtsenc: do not pass NULL to av_log()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavformat/adtsenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index b5e9640544..c5765cc92e 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -127,14 +127,14 @@  static int adts_write_header(AVFormatContext *s)
     return 0;
 }
 
-static int adts_write_frame_header(ADTSContext *ctx,
+static int adts_write_frame_header(AVFormatContext *s, ADTSContext *ctx,
                                    uint8_t *buf, int size, int pce_size)
 {
     PutBitContext pb;
 
     unsigned full_frame_size = (unsigned)ADTS_HEADER_SIZE + size + pce_size;
     if (full_frame_size > ADTS_MAX_FRAME_BYTES) {
-        av_log(NULL, AV_LOG_ERROR, "ADTS frame size too large: %u (max %d)\n",
+        av_log(s, AV_LOG_ERROR, "frame size too large: %u (max %d)\n",
                full_frame_size, ADTS_MAX_FRAME_BYTES);
         return AVERROR_INVALIDDATA;
     }
@@ -192,7 +192,7 @@  static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
         }
     }
     if (adts->write_adts) {
-        int err = adts_write_frame_header(adts, buf, pkt->size,
+        int err = adts_write_frame_header(s, adts, buf, pkt->size,
                                              adts->pce_size);
         if (err < 0)
             return err;
-- 
2.39.1