You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
494 B
15 lines
494 B
diff --git a/libdjvu/DjVuText.cpp b/libdjvu/DjVuText.cpp
|
|
index 60a4f39..b11df7b 100644
|
|
--- a/libdjvu/DjVuText.cpp
|
|
+++ b/libdjvu/DjVuText.cpp
|
|
@@ -345,7 +345,8 @@ DjVuTXT::decode(const GP<ByteStream> &gbs)
|
|
int textsize = bs.read24();
|
|
char *buffer = textUTF8.getbuf(textsize);
|
|
int readsize = bs.read(buffer,textsize);
|
|
- buffer[readsize] = 0;
|
|
+ if (buffer)
|
|
+ buffer[readsize] = 0;
|
|
if (readsize < textsize)
|
|
G_THROW( ERR_MSG("DjVuText.corrupt_chunk") );
|
|
// Try reading zones
|