hls: Avoid coverity warning about access off the end of an array.
authorJan Schmidt <jan@centricular.com>
Thu, 4 Aug 2016 12:21:16 +0000 (22:21 +1000)
committerJan Schmidt <jan@centricular.com>
Thu, 4 Aug 2016 12:22:44 +0000 (22:22 +1000)
Fixes CID 1364755

ext/hls/m3u8.c

index 05f9188..bdb4acf 100644 (file)
@@ -1039,7 +1039,7 @@ gst_m3u8_hls_media_type_get_nick (GstHLSMediaType mtype)
     "subtitle", "closed-captions"
   };
 
-  if (mtype < 0 || mtype > GST_HLS_N_MEDIA_TYPES)
+  if (mtype < 0 || mtype >= GST_HLS_N_MEDIA_TYPES)
     return "invalid";
 
   return nicks[mtype];