mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
bytewriter: Fix possible infinite loop caused by an overflow
This commit is contained in:
parent
863d783beb
commit
3ee6ae4030
1 changed files with 2 additions and 2 deletions
|
@ -174,10 +174,10 @@ _gst_byte_writer_next_pow2 (guint n)
|
|||
|
||||
/* We start with 16, smaller allocations make no sense */
|
||||
|
||||
while (ret < n)
|
||||
while (ret < n && ret > 0)
|
||||
ret <<= 1;
|
||||
|
||||
return ret;
|
||||
return ret ? ret : n;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
|
|
Loading…
Reference in a new issue