[FFmpeg-devel] [PATCH]lavc/h264_ps: Check chroma_location limits

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Mar 24 11:40:21 EET 2017


Hi!

Attached patch fixes #6255.

Please comment, Carl Eugen
-------------- next part --------------
From 1c249440c62271565be12112f321ad9aa6a922fb Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos at ag.or.at>
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 */
     }
 
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list