diff options
author | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2005-06-18 21:43:31 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2005-06-18 21:43:31 (GMT) |
commit | 71cfbd5e3ec158efcb49c896bd4468764a9a54fb (patch) | |
tree | a13871c85a8718ca37678f39646cba5eaa406fb6 /dvi/dvi-document.c | |
parent | f302b9a420aaf02e5805b3225ce4fef5a63e9b67 (diff) |
Check for incorrect dvi files. Fix parsing dvi on AMD64 platform. Thanks
* 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).
Diffstat (limited to 'dvi/dvi-document.c')
-rw-r--r-- | dvi/dvi-document.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/dvi/dvi-document.c b/dvi/dvi-document.c index 4285f68..d0307e3 100644 --- a/dvi/dvi-document.c +++ b/dvi/dvi-document.c @@ -28,6 +28,7 @@ #include "pixbuf-device.h" #include <gtk/gtk.h> +#include <glib/gi18n.h> GMutex *dvi_context_mutex = NULL; @@ -81,14 +82,27 @@ dvi_document_load (EvDocument *document, 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 |