From patchwork Fri Mar 24 09:40:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 3082 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp11842vsy; Fri, 24 Mar 2017 02:40:42 -0700 (PDT) X-Received: by 10.28.40.198 with SMTP id o189mr2095113wmo.108.1490348441857; Fri, 24 Mar 2017 02:40:41 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u11si2376701wru.73.2017.03.24.02.40.41; Fri, 24 Mar 2017 02:40:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8AC7B68838D; Fri, 24 Mar 2017 11:40:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-3.mx.upcmail.net (vie01a-dmta-pe04-3.mx.upcmail.net [62.179.121.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E206668829F for ; Fri, 24 Mar 2017 11:40:10 +0200 (EET) Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1crLhu-0003Mn-Jw for ffmpeg-devel@ffmpeg.org; Fri, 24 Mar 2017 10:40:30 +0100 Received: from [192.168.1.3] ([80.110.112.221]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id zlgM1u01N4mfhPU01lgNvw; Fri, 24 Mar 2017 10:40:22 +0100 X-SourceIP: 80.110.112.221 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Fri, 24 Mar 2017 10:40:21 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201703241040.21244.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavc/h264_ps: Check chroma_location limits 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" Hi! Attached patch fixes #6255. Please comment, Carl Eugen From 1c249440c62271565be12112f321ad9aa6a922fb Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Fri, 24 Mar 2017 10:38:22 +0100 Subject: [PATCH] lavc/h264_ps: Check that chroma_location is within limits. Fixes ticket #6255. --- libavcodec/h264_ps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c index b78ad25..55e6a6e 100644 --- a/libavcodec/h264_ps.c +++ b/libavcodec/h264_ps.c @@ -181,6 +181,8 @@ static inline int decode_vui_parameters(GetBitContext *gb, AVCodecContext *avctx if (get_bits1(gb)) { /* chroma_sample_location_type_top_field */ avctx->chroma_sample_location = get_ue_golomb(gb) + 1; + if (avctx->chroma_sample_location >= AVCHROMA_LOC_NB) + avctx->chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED; get_ue_golomb(gb); /* chroma_sample_location_type_bottom_field */ }