[FFmpeg-cvslog] avcodec/hevc_ps: Check default display window bitstream and skip if invalid

Michael Niedermayer git at videolan.org
Sat Nov 1 13:35:31 CET 2014


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 27 14:03:09 2014 +0100| [045670a6f7e46d2ab84df0214282bbb07e0eef9c] | committer: Michael Niedermayer

avcodec/hevc_ps: Check default display window bitstream and skip if invalid

Fixes Ticket4035

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 852aaead1fc294bcb63a1f9e384e781f6e51ded6)

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

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

 libavcodec/hevc_ps.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index c17ca04..4e1c561 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -525,7 +525,11 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
     vui->field_seq_flag                = get_bits1(gb);
     vui->frame_field_info_present_flag = get_bits1(gb);
 
-    vui->default_display_window_flag = get_bits1(gb);
+    if (get_bits_left(gb) >= 68 && show_bits_long(gb, 21) == 0x100000) {
+        vui->default_display_window_flag = 0;
+        av_log(s->avctx, AV_LOG_WARNING, "Invalid default display window\n");
+    } else
+        vui->default_display_window_flag = get_bits1(gb);
     // Backup context in case an alternate header is detected
     memcpy(&backup, gb, sizeof(backup));
 



More information about the ffmpeg-cvslog mailing list