wavpackenc: make assert more thorough
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Fri, 22 Aug 2014 09:31:43 +0000 (09:31 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 22 Aug 2014 10:30:10 +0000 (12:30 +0200)
It was only validating that normal data wasn't filling the buffer.
However, extra data may be written afterwards.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/wavpackenc.c

index 169836a..299a035 100644 (file)
@@ -2813,7 +2813,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s,
     block_size = bytestream2_tell_p(&pb);
     AV_WL32(out + 4, block_size - 8);
 
-    av_assert0(put_bits_left(&s->pb) > 0);
+    av_assert0(!bytestream2_get_eof(&pb));
 
     return block_size;
 }