diff options
Diffstat (limited to 'libavcodec/8bps.c')
-rw-r--r-- | libavcodec/8bps.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 2c03e8b4a3..c46c8c1c00 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -96,7 +96,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, if ((count = *dp++) <= 127) { count++; dlen -= count + 1; - if (pixptr + count * planes > pixptr_end) + if (pixptr_end - pixptr < count * planes) break; if (ep - dp < count) return AVERROR_INVALIDDATA; @@ -106,7 +106,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, } } else { count = 257 - count; - if (pixptr + count * planes > pixptr_end) + if (pixptr_end - pixptr < count * planes) break; while (count--) { *pixptr = *dp; |