init_get_bits8: zero pointers & struct on error
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 14 Jan 2013 15:23:39 +0000 (16:23 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 19 Jan 2013 16:59:22 +0000 (17:59 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 153fad14e5a2f85637aa6c254ced0fc1c68974e2)

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

index 1946c78..964456e 100644 (file)
@@ -407,7 +407,7 @@ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
                                  int byte_size)
 {
     if (byte_size > INT_MAX / 8 || byte_size < 0)
-        return AVERROR_INVALIDDATA;
+        byte_size = -1;
     return init_get_bits(s, buffer, byte_size * 8);
 }