@@ -932,10 +932,10 @@ pdf_load_object(hd_context *ctx, pdf_document *doc, int num)
932932{
933933 pdf_xref_entry * entry = pdf_cache_object (ctx , doc , num );
934934 //assert(entry->obj != NULL);
935- if (entry -> obj ! = NULL )
936- return pdf_keep_obj (ctx , entry -> obj );
937- else
938- return NULL ;
935+ if (entry -> obj = = NULL )
936+ hd_throw (ctx , HD_ERROR_GENERIC , "pdf_load_object is NULL" );
937+
938+ return pdf_keep_obj ( ctx , entry -> obj ) ;
939939}
940940
941941static void
@@ -1042,12 +1042,14 @@ pdf_init_document(hd_context *ctx, pdf_document *doc)
10421042 hd_try (ctx )
10431043 {
10441044 dict = pdf_load_object (ctx , doc , i );
1045- if (dict == NULL )
1046- hd_throw (ctx , HD_ERROR_GENERIC , "ignoring broken object (%d 0 R)" , i );
1045+ /* if (dict == NULL)
1046+ hd_throw(ctx, HD_ERROR_GENERIC, "ignoring broken object (%d 0 R)", i);*/
10471047 }
10481048 hd_catch (ctx )
10491049 {
1050- hd_rethrow (ctx );
1050+ hd_rethrow_if (ctx , HD_ERROR_TRYLATER );
1051+ hd_warn (ctx , "ignoring broken object (%d 0 R)" , i );
1052+ continue ;
10511053 }
10521054
10531055 if (!hasroot )
@@ -1078,7 +1080,8 @@ pdf_init_document(hd_context *ctx, pdf_document *doc)
10781080 }
10791081 hd_catch (ctx )
10801082 {
1081- pdf_drop_obj (ctx , dict );
1083+ if (dict != NULL )
1084+ pdf_drop_obj (ctx , dict );
10821085 hd_rethrow (ctx );
10831086 }
10841087}
0 commit comments