From patchwork Sun Dec 15 22:00:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 16807 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 1175E44A111 for ; Mon, 16 Dec 2019 00:03:44 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E869668A3BA; Mon, 16 Dec 2019 00:03:43 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B4E3D689B1E for ; Mon, 16 Dec 2019 00:03:37 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1igbzF-0002wg-0U for ffmpeg-devel@ffmpeg.org; Sun, 15 Dec 2019 23:03:37 +0100 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id gbyGiP1ngwlysgbyGizRhD; Sun, 15 Dec 2019 23:02:37 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=E5OzWpVl c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=LI68P0QzG2f3VGdOBgQA:9 a=_tll4YNsBCp1cEro:21 a=cXnqpXu7TMiNc0gI:21 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 15 Dec 2019 23:00:28 +0100 Message-Id: <20191215220029.28817-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfBWZq/Sk74ZzDh4vofzNpv+JC4KYJhoMSSqLwDYnnIk3+Ny5qOWLOtLxe1RzaL9NKuRtYdm9Nwo80ZTeKyOxta5GqWi8UN43D818J+B4YozozF1B0eK4 /OcLmImS+R8PFjm3wh3QCmWiP0FcvbUlqWLKx/3nRdgCoxPMHy38Vn+D Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/h264_ps: Check for truncation at fixed_frame_rate_flag 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" Fixes: Ticket7249 (No longer displaying a scary red message) Signed-off-by: Michael Niedermayer --- libavcodec/h264_ps.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index e8738d8502..74f12f8979 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -203,6 +203,10 @@ static inline int decode_vui_parameters(GetBitContext *gb, AVCodecContext *avctx sps->num_units_in_tick = num_units_in_tick; sps->time_scale = time_scale; } + if (get_bits_left(gb) == 0) { + av_log(avctx, AV_LOG_WARNING, "Truncated VUI before fixed_frame_rate_flag\n"); + return 0; + } sps->fixed_frame_rate_flag = get_bits1(gb); }