Fixes Ticket4778
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
... | ... |
@@ -201,7 +201,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, |
201 | 201 |
buf += ctx->length_size; |
202 | 202 |
unit_type = *buf & 0x1f; |
203 | 203 |
|
204 |
- if (buf + nal_size > buf_end || nal_size < 0) |
|
204 |
+ if (nal_size > buf_end - buf || nal_size < 0) |
|
205 | 205 |
goto fail; |
206 | 206 |
|
207 | 207 |
if (unit_type == 7) |