mov: Correctly check the color transfer characteristics range
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 13 Oct 2014 12:34:24 +0000 (13:34 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 15 Oct 2014 13:48:40 +0000 (14:48 +0100)
Reported-by: Ruoyu <liangry@ucweb.com>
libavformat/mov.c

index 2b64cbf..0e29bf3 100644 (file)
@@ -923,7 +923,8 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
          * 23001-8) so some adjusting is required */
         if (color_primaries >= AVCOL_PRI_FILM)
             color_primaries = AVCOL_PRI_UNSPECIFIED;
-        if (color_trc >= AVCOL_TRC_LINEAR || color_trc <= AVCOL_TRC_LOG_SQRT ||
+        if ((color_trc >= AVCOL_TRC_LINEAR &&
+             color_trc <= AVCOL_TRC_LOG_SQRT) ||
             color_trc >= AVCOL_TRC_BT2020_10)
             color_trc = AVCOL_TRC_UNSPECIFIED;
         if (color_matrix >= AVCOL_SPC_BT2020_NCL)