[FFmpeg-cvslog] avcodec/h264_ps: try to support Ambarella AVC

Michael Niedermayer git at videolan.org
Tue Jul 9 05:32:18 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  9 05:21:26 2013 +0200| [00b1401df6563e78c8616df4c62b8b5d6ac511a3] | committer: Michael Niedermayer

avcodec/h264_ps: try to support Ambarella AVC

Fixes Ticket2763

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00b1401df6563e78c8616df4c62b8b5d6ac511a3
---

 libavcodec/h264_ps.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index ea121ed..a455545 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -224,6 +224,11 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
         get_ue_golomb(&h->gb);  /* chroma_sample_location_type_bottom_field */
     }
 
+    if (show_bits1(&h->gb) && get_bits_left(&h->gb) < 10) {
+        av_log(h->avctx, AV_LOG_WARNING, "Truncated VUI\n");
+        return 0;
+    }
+
     sps->timing_info_present_flag = get_bits1(&h->gb);
     if(sps->timing_info_present_flag){
         sps->num_units_in_tick = get_bits_long(&h->gb, 32);



More information about the ffmpeg-cvslog mailing list