From patchwork Mon Dec 31 21:03:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 11617 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 279FF44CE54 for ; Mon, 31 Dec 2018 23:04:30 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D9C9168A85E; Mon, 31 Dec 2018 23:04:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-3.mx.upcmail.net (vie01a-dmta-pe05-3.mx.upcmail.net [84.116.36.13]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59CE268A586 for ; Mon, 31 Dec 2018 23:04:18 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe05.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1ge4ja-0003tx-0X for ffmpeg-devel@ffmpeg.org; Mon, 31 Dec 2018 22:04:26 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id e4icghziC2WSse4icg2OEP; Mon, 31 Dec 2018 22:03:26 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=E7kcWpVl c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=r9ig5tghJs7nBZjKuAYA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Dec 2018 22:03:16 +0100 Message-Id: <20181231210318.6130-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181231210318.6130-1-michael@niedermayer.cc> References: <20181231210318.6130-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKNZW7tpBPFqhoCkNx93owsiCKpAqa55bVBsq7NJuqnoe2EwTsbXed8yddVU2f7W/cq2sY0/nBoUZfmWu5Tko7ACvZPEPdXZ7DqP+k9r3Z4AtDgNXM3r iax0R9clvayNubdzpQr5qFPV/pby9etLcJs1I9x8mxy+uae6IfXJorSp Subject: [FFmpeg-devel] [PATCH 09/11] avcodec/mss2: Provide non NULL context to av_log() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/mss2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index 3180af1d60..2eb366ee78 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -174,7 +174,7 @@ static int decode_pal_v2(MSS12Context *ctx, const uint8_t *buf, int buf_size) return 1 + ncol * 3; } -static int decode_555(GetByteContext *gB, uint16_t *dst, ptrdiff_t stride, +static int decode_555(AVCodecContext *avctx, GetByteContext *gB, uint16_t *dst, ptrdiff_t stride, int keyframe, int w, int h) { int last_symbol = 0, repeat = 0, prev_avail = 0; @@ -212,7 +212,7 @@ static int decode_555(GetByteContext *gB, uint16_t *dst, ptrdiff_t stride, repeat = 0; while (b-- > 130) { if (repeat >= (INT_MAX >> 8) - 1) { - av_log(NULL, AV_LOG_ERROR, "repeat overflow\n"); + av_log(avctx, AV_LOG_ERROR, "repeat overflow\n"); return AVERROR_INVALIDDATA; } repeat = (repeat << 8) + bytestream2_get_byte(gB) + 1; @@ -634,7 +634,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (is_555) { bytestream2_init(&gB, buf, buf_size); - if (decode_555(&gB, (uint16_t *)c->rgb_pic, c->rgb_stride >> 1, + if (decode_555(avctx, &gB, (uint16_t *)c->rgb_pic, c->rgb_stride >> 1, keyframe, avctx->width, avctx->height)) return AVERROR_INVALIDDATA;