The decoder assumes a single bit depth for all the planes while
the specification allows different bit depths for luma and chroma.

Avoid the possible problems described in CVE-2013-2277
---

Check moved when Janne asked, typo removed.

 libavcodec/h264.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f3a47fe..0ddab52 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2768,6 +2768,12 @@ static int decode_slice_header(H264Context *h, 
H264Context *h0){
                       h->sps.num_units_in_tick, den, 1<<30);
         }
 
+        if (h->sps.bit_depth_luma != h->sps.bit_depth_chroma) {
+            av_log_missing_feature(s->avctx,
+                "Different bit depth between chroma and luma", 1);
+            return AVERROR_PATCHWELCOME;
+        }
+
         switch (h->sps.bit_depth_luma) {
             case 9 :
                 if (CHROMA444) {
-- 
1.8.1.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to