bytewriter: Fix possible infinite loop caused by an overflow

This commit is contained in:
Sebastian Dröge 2010-10-08 09:47:12 +02:00
parent 863d783beb
commit 3ee6ae4030

View file

@ -174,10 +174,10 @@ _gst_byte_writer_next_pow2 (guint n)
/* We start with 16, smaller allocations make no sense */ /* We start with 16, smaller allocations make no sense */
while (ret < n) while (ret < n && ret > 0)
ret <<= 1; ret <<= 1;
return ret; return ret ? ret : n;
} }
static inline gboolean static inline gboolean