mirror of
https://github.com/YACReader/yacreader
synced 2025-07-23 07:24:58 -04:00
Fix problems with missing safety checks in Render::fillBuffer and pdfcomic
This commit is contained in:
44
common/pdf_comic.h
Normal file
44
common/pdf_comic.h
Normal file
@ -0,0 +1,44 @@
|
||||
#if !defined PDF_COMIC_H && !defined NO_PDF
|
||||
#define PDF_COMIC_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
#if defined Q_OS_MAC && defined USE_PDFKIT
|
||||
class MacOSXPDFComic
|
||||
{
|
||||
public:
|
||||
MacOSXPDFComic();
|
||||
~MacOSXPDFComic();
|
||||
bool openComic(const QString & path);
|
||||
void closeComic();
|
||||
unsigned int numPages();
|
||||
QImage getPage(const int page);
|
||||
//void releaseLastPageData();
|
||||
|
||||
private:
|
||||
void * document;
|
||||
void * lastPageData;
|
||||
};
|
||||
|
||||
#elif defined USE_PDFIUM
|
||||
#include <fpdfview.h>
|
||||
|
||||
class PdfiumComic
|
||||
{
|
||||
public:
|
||||
PdfiumComic();
|
||||
~PdfiumComic();
|
||||
bool openComic(const QString & path);
|
||||
void closeComic();
|
||||
unsigned int numPages();
|
||||
QImage getPage(const int page);
|
||||
|
||||
private:
|
||||
FPDF_LIBRARY_CONFIG config;
|
||||
FPDF_DOCUMENT doc;
|
||||
};
|
||||
#else
|
||||
#include "poppler-qt5.h"
|
||||
#endif // Q_OS_MAC
|
||||
#endif // PDF_COMIC_H
|
Reference in New Issue
Block a user