On 13/01/13 22:42, Justin Ruggles wrote:
> Isn't the result of an overflow technically undefined, not negative? How
> safe is checking for a negative value to detect overflow after-the-fact?

It is not, that is yet another bug in this part, put_bits probably has
the same problem.

int init_get_bits(GetBitContext *s, const uint8_t *buffer, unsigned
bit_size)

int init_get_bits8(GetBitContext *s, const uint8_t *buffer, unsigned
byte_size)

and we check for blah_size > $overflow_condition and ripple up the error
in case.

Sounds ok?

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to