shithub: dav1d

Download patch

ref: d69fc655a2973f8fcf9125e0d5a83e8cd3e6920e
parent: 1b9792f3389c154aac6509b02f5eba17fceb59db
author: Henrik Gramner <gramner@twoorioles.com>
date: Fri Jul 10 22:16:34 EDT 2020

Add enum entries for the maximum valid metadata values

A bitstream may contain values larger than the currently defined
entries, but it's technically UB to put such values into an enum.

Discovered in Firefox through fuzzing with UBSan.

--- a/include/dav1d/headers.h
+++ b/include/dav1d/headers.h
@@ -127,6 +127,7 @@
     DAV1D_COLOR_PRI_SMPTE431 = 11,
     DAV1D_COLOR_PRI_SMPTE432 = 12,
     DAV1D_COLOR_PRI_EBU3213 = 22,
+    DAV1D_COLOR_PRI_RESERVED = 255,
 };
 
 enum Dav1dTransferCharacteristics {
@@ -147,6 +148,7 @@
     DAV1D_TRC_SMPTE2084 = 16,     ///< PQ
     DAV1D_TRC_SMPTE428 = 17,
     DAV1D_TRC_HLG = 18,           ///< hybrid log/gamma (BT.2100 / ARIB STD-B67)
+    DAV1D_TRC_RESERVED = 255,
 };
 
 enum Dav1dMatrixCoefficients {
@@ -164,6 +166,7 @@
     DAV1D_MC_CHROMAT_NCL = 12, ///< Chromaticity-derived
     DAV1D_MC_CHROMAT_CL = 13,
     DAV1D_MC_ICTCP = 14,
+    DAV1D_MC_RESERVED = 255,
 };
 
 enum Dav1dChromaSamplePosition {