Bug 707620

Summary: Division by zero in fz_new_pixmap_from_float_data()
Product: MuPDF Reporter: Sebastian Rasmussen <sebastian.rasmussen>
Component: mupdfAssignee: MuPDF bugs <mupdf-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.24.0   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---

Description Sebastian Rasmussen 2024-02-28 13:11:54 UTC
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-51103

https://github.com/dongyuma/sox-defects/blob/main/mupdf-defects.md#2-a-floating-point-exception-divide-by-zero-issue-was-discovered-in-mupdf-in-functon-fz_new_pixmap_from_float_data-of-pixmapc-in-line-1330

A floating point exception (divide-by-zero) vulnerability was discovered in mupdf 1.23.4 in functon fz_new_pixmap_from_float_data() of pixmap.c.
Comment 1 Sebastian Rasmussen 2024-03-01 15:08:58 UTC
Fixed in

commit f1b5f87edd2675d5c79301e4ef2e1139f67f904b
Author: Sebastian Rasmussen <sebras@gmail.com>
Date:   Wed Feb 28 21:08:56 2024 +0800

    Bug 707620: Check dimensions of float sample conversion buffer.
    
    This is implicitly done by allocating the destination pixmap, which
    restricts both dimensions and number of components of the image.
    
    Also ensure that the number of samples computation does not overflow,
    and consistently use size_t instead of int for buffer sizes/indexes.
    
    This fixes CVE-2023-51103.