File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ static inline void
180180background_images (PyObject * src , Options * opts ) {
181181 static unsigned generation = 0 ;
182182 size_t new_count = (PyTuple_Check (src ) && PyTuple_GET_SIZE (src ) > 0 ) ? (size_t )PyTuple_GET_SIZE (src ) : 0 ;
183- if (new_count == opts -> background_images .count ) {
183+ if (new_count == opts -> background_images .count && opts -> background_images . entries ) {
184184 bool changed = false;
185185 for (size_t i = 0 ; i < new_count ; i ++ ) {
186186 const char * p = PyUnicode_AsUTF8 (PyTuple_GET_ITEM (src , i ));
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ increment_bg_image_idx(size_t idx, int delta) {
275275 }
276276 if ((unsigned )abs (delta ) <= idx ) return idx + delta ;
277277 // wrap to last image, which means we need to load all
278- global_background_image (OPT (background_images ).count );
278+ if ( OPT ( background_images ). count > 0 ) global_background_image (OPT (background_images ).count - 1 );
279279 return global_state .background_images .count ? global_state .background_images .count - 1 : 0 ;
280280}
281281
You can’t perform that action at this time.
0 commit comments