lavc/h264_levels: Avoid integer overflow in bitrate
authorMark Thompson <sw@jkqxz.net>
Mon, 24 Sep 2018 22:03:32 +0000 (23:03 +0100)
committerMark Thompson <sw@jkqxz.net>
Mon, 24 Sep 2018 22:08:45 +0000 (23:08 +0100)
Fixes CID #1439656.

libavcodec/h264_levels.c

index 6b4e18a..737b7dc 100644 (file)
@@ -105,7 +105,7 @@ const H264LevelDescriptor *ff_h264_guess_level(int profile_idc,
         if (level->constraint_set3_flag && no_cs3f)
             continue;
 
-        if (bitrate > level->max_br * h264_get_br_factor(profile_idc))
+        if (bitrate > (int64_t)level->max_br * h264_get_br_factor(profile_idc))
             continue;
 
         if (width_mbs  * height_mbs > level->max_fs)