lavc/h265_profile_level: Avoid integer overflow in bitrate
authorMark Thompson <sw@jkqxz.net>
Mon, 24 Sep 2018 22:00:43 +0000 (23:00 +0100)
committerMark Thompson <sw@jkqxz.net>
Mon, 24 Sep 2018 22:09:45 +0000 (23:09 +0100)
Fixes CIDs #1439659 and #1439660.

libavcodec/h265_profile_level.c

index aac1529..bc67fdc 100644 (file)
@@ -224,7 +224,7 @@ const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *pt
             max_br = level->max_br_main;
         if (!max_br)
             continue;
-        if (bitrate > profile->cpb_nal_factor * hbr_factor * max_br)
+        if (bitrate > (int64_t)profile->cpb_nal_factor * hbr_factor * max_br)
             continue;
 
         if (pic_size < (level->max_luma_ps >> 2))