fix some pointer to intger without cast warnings (patch by Michel Bardiaux)
authorMichel Bardiaux <mbardiaux@peaktime.be>
Wed, 21 Sep 2005 23:18:52 +0000 (23:18 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Wed, 21 Sep 2005 23:18:52 +0000 (23:18 +0000)
Originally committed as revision 4610 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/bitstream.h

index 9616d5f0faabcdcafd5d7861a598442159ad283c..0182b630b11ab390c1706849a2e45d0c1c10ec4a 100644 (file)
@@ -53,8 +53,10 @@ typedef struct PutBitContext {
 
 static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
 {
-    if(buffer_size < 0)
-        buffer= buffer_size= 0;
+    if(buffer_size < 0) {
+        buffer_size = 0;
+        buffer = NULL;
+    }
 
     s->buf = buffer;
     s->buf_end = s->buf + buffer_size;
@@ -676,8 +678,10 @@ static inline void init_get_bits(GetBitContext *s,
                    const uint8_t *buffer, int bit_size)
 {
     int buffer_size= (bit_size+7)>>3;
-    if(buffer_size < 0 || bit_size < 0)
-        buffer= buffer_size= bit_size= 0;
+    if(buffer_size < 0 || bit_size < 0) {
+        buffer_size = bit_size = 0;
+        buffer = NULL;
+    }
 
     s->buffer= buffer;
     s->size_in_bits= bit_size;