+2005-06-19 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
+
+ * dvi/dvi-document.c: (dvi_document_load):
+ * dvi/mdvi-lib/dviread.c: (mdvi_init_context):
+ * po/POTFILES.in:
+
+ Check for incorrect dvi files. Fix parsing dvi on AMD64
+ platform. Thanks to tester@tester.ca (Olivier Crete).
+
2005-06-18 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
* shell/ev-page-action.c: (match_selected_cb),
#include "pixbuf-device.h"
#include <gtk/gtk.h>
+#include <glib/gi18n.h>
GMutex *dvi_context_mutex = NULL;
filename = g_filename_from_uri (uri, NULL, error);
- if (!filename)
- return FALSE;
+ if (!filename) {
+ g_set_error (error,
+ EV_DOCUMENT_ERROR,
+ EV_DOCUMENT_ERROR_INVALID,
+ _("File not available"));
+ return FALSE;
+ }
if (dvi_document->context)
mdvi_destroy_context (dvi_document->context);
dvi_document->context = mdvi_init_context(dvi_document->params, dvi_document->spec, filename);
+ if (!dvi_document->context) {
+ g_set_error (error,
+ EV_DOCUMENT_ERROR,
+ EV_DOCUMENT_ERROR_INVALID,
+ _("DVI document has incorrect format"));
+ return FALSE;
+ }
+
mdvi_pixbuf_device_init (&dvi_document->context->device);
dvi_document->base_width = dvi_document->context->dvi_page_w * dvi_document->context->params.conv
for(i = 1; i <= 10; i++)
page[i] = fsget4(p);
page[0] = offset;
- offset = (long)fuget4(p);
+ offset = fsget4(p);
/* check if the page is selected */
if(spec && mdvi_page_selected(spec, page, n) == 0) {
DEBUG((DBG_DVI, "Page %d (%ld.%ld.%ld.%ld.%ld.%ld.%ld.%ld.%ld.%ld) ignored by request\n",