From a1f6ffd44d115e9ccc4e1acb2219e7d8bf6c0d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sun, 29 Mar 2009 17:50:46 +0000 Subject: [PATCH] Change CHECK_STREAM_PTR macro to correctly handle the (extremely unlikely) overflow case. Originally committed as revision 18224 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/interplayvideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 529c3193ef..2fcc911967 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -76,7 +76,7 @@ typedef struct IpvideoContext { } IpvideoContext; #define CHECK_STREAM_PTR(n) \ - if ((s->stream_ptr + n) > s->stream_end) { \ + if (s->stream_end - s->stream_ptr < n) { \ av_log(s->avctx, AV_LOG_ERROR, "Interplay video warning: stream_ptr out of bounds (%p >= %p)\n", \ s->stream_ptr + n, s->stream_end); \ return -1; \