From d359a8f9ef5fe6c8ac1d8c1bd0d1e7c412586bf9 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Tue, 13 Aug 2002 03:48:56 +0000 Subject: [PATCH] Changed ReadAt() return codes so that when ReadAt() is called with pos >= the size of the BBitmap, it returns B_ERROR instead of B_BAD_VALUE. The BBitmapTranslator expects B_ERROR to be returned in this case and will return an error code as the result to the Translate call if B_ERROR is not returned. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@732 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/translation/BitmapStream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kits/translation/BitmapStream.cpp b/src/kits/translation/BitmapStream.cpp index 3e372c1435..ff9cd8277b 100644 --- a/src/kits/translation/BitmapStream.cpp +++ b/src/kits/translation/BitmapStream.cpp @@ -127,9 +127,9 @@ BBitmapStream::~BBitmapStream() status_t BBitmapStream::ReadAt(off_t pos, void *buffer, size_t size) { - if (!buffer || pos < 0 || pos >= fSize) + if (!buffer || pos < 0) return B_BAD_VALUE; - if (!fBitmap) + if (!fBitmap || pos >= fSize) return B_ERROR; if (!size) return B_NO_ERROR;