Blame SOURCES/djvulibre-3.5.27-zero-bytes-check.patch

a9380a
From 9658b01431cd7ff6344d7787f855179e73fe81a7 Mon Sep 17 00:00:00 2001
a9380a
From: Leon Bottou <leon@bottou.org>
a9380a
Date: Mon, 8 Apr 2019 22:55:38 -0400
a9380a
Subject: fix bug #298
a9380a
a9380a
a9380a
diff --git a/libdjvu/GBitmap.h b/libdjvu/GBitmap.h
a9380a
index e8e0c9b..ca89a19 100644
a9380a
--- a/libdjvu/GBitmap.h
a9380a
+++ b/libdjvu/GBitmap.h
a9380a
@@ -566,7 +566,7 @@ GBitmap::operator[](int row)
a9380a
 {
a9380a
   if (!bytes) 
a9380a
     uncompress();
a9380a
-  if (row<0 || row>=nrows) {
a9380a
+  if (row<0 || row>=nrows || !bytes) {
a9380a
 #ifndef NDEBUG
a9380a
     if (zerosize < bytes_per_row + border)
a9380a
       G_THROW( ERR_MSG("GBitmap.zero_small") );
a9380a
@@ -581,7 +581,7 @@ GBitmap::operator[](int row) const
a9380a
 {
a9380a
   if (!bytes) 
a9380a
     ((GBitmap*)this)->uncompress();
a9380a
-  if (row<0 || row>=nrows) {
a9380a
+  if (row<0 || row>=nrows || !bytes) {
a9380a
 #ifndef NDEBUG
a9380a
     if (zerosize < bytes_per_row + border)
a9380a
       G_THROW( ERR_MSG("GBitmap.zero_small") );