[FFmpeg-cvslog] h264_ps: when parsing a VUI fails, only abort when explode is set

Anton Khirnov git at videolan.org
Mon Oct 28 11:20:57 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Oct 26 10:22:31 2013 +0200| [94603feb1b3ad01a821a1a1cef1570b13f471821] | committer: Anton Khirnov

h264_ps: when parsing a VUI fails, only abort when explode is set

A VUI doesn't contain anything strictly necessary for decoding.
Apparently there are many samples with truncated VUIs in the wild, this
commit should allow decoding them.

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

 libavcodec/h264_ps.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index dfdb739..54b735d 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -465,9 +465,11 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
     }
 
     sps->vui_parameters_present_flag = get_bits1(&h->gb);
-    if (sps->vui_parameters_present_flag)
-        if (decode_vui_parameters(h, sps) < 0)
+    if (sps->vui_parameters_present_flag) {
+        int ret = decode_vui_parameters(h, sps);
+        if (ret < 0 && h->avctx->err_recognition & AV_EF_EXPLODE)
             goto fail;
+    }
 
     if (!sps->sar.den)
         sps->sar.den = 1;



More information about the ffmpeg-cvslog mailing list