Commit 35e82e13 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix corrupt R0 during JPEG plot

The JPEG_PlotScaled SWI (and friends) was pulling R0 at the wrong moment, so corrupting it. This manifested as "Incomplete or corrupt JPEG" when trying to plot a JPEG via the PostScript driver for example (which expects R0 preserved for no error).
Looks like ~5 year old bug, presumably not many people printing JPEGs to PostScript, or all suffering in silence.
Tested on a Risc PC - printed a picture from !Draw to postscript, then PDF'd it.

Version 1.69. Tagged as 'SprExtend-1_69'
parent 3b0af7b5
......@@ -448,8 +448,8 @@ jpegscaled_exit
MOV r1, sp
Debug gs,"ok1. sp = ",r1
]
Pull "R0" ; original R0 (pjs_r0save)
ADD sp,sp,#pjs_end-pjs_table ; junk the fake sprite and colourtrans table
Pull "R0" ; original R0 (pjs_jpegdata)
Debug gs,"r0 when loaded =",R0
[ debuggs
MOV r1, sp
......@@ -461,7 +461,7 @@ jpegscaled_exit
Debug gs,"X R8-9",R8,R9
MOV pc, lr
20
ADD sp,sp,#4 ; junk pjs_jpegdata
ADD sp,sp,#4 ; junk pjs_r0save
SUB sp,sp,#pjs_table-pjs_start ; correct for the ADD in 'jpegscaled_errorexit' moving stack too far.
TST r0, #ERROR_BAD_JPEG ; C code returned bad jpeg error
BNE jpegscaled_errorexit1
......
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.68"
Module_Version SETA 168
Module_MajorVersion SETS "1.69"
Module_Version SETA 169
Module_MinorVersion SETS ""
Module_Date SETS "26 Sep 2015"
Module_ApplicationDate SETS "26-Sep-15"
Module_Date SETS "11 Jan 2016"
Module_ApplicationDate SETS "11-Jan-16"
Module_ComponentName SETS "SprExtend"
Module_ComponentPath SETS "mixed/RiscOS/Sources/Video/Render/SprExtend"
Module_FullVersion SETS "1.68"
Module_HelpVersion SETS "1.68 (26 Sep 2015)"
Module_FullVersion SETS "1.69"
Module_HelpVersion SETS "1.69 (11 Jan 2016)"
END
/* (1.68)
/* (1.69)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.68
#define Module_MajorVersion_CMHG 1.69
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 26 Sep 2015
#define Module_Date_CMHG 11 Jan 2016
#define Module_MajorVersion "1.68"
#define Module_Version 168
#define Module_MajorVersion "1.69"
#define Module_Version 169
#define Module_MinorVersion ""
#define Module_Date "26 Sep 2015"
#define Module_Date "11 Jan 2016"
#define Module_ApplicationDate "26-Sep-15"
#define Module_ApplicationDate "11-Jan-16"
#define Module_ComponentName "SprExtend"
#define Module_ComponentPath "mixed/RiscOS/Sources/Video/Render/SprExtend"
#define Module_FullVersion "1.68"
#define Module_HelpVersion "1.68 (26 Sep 2015)"
#define Module_LibraryVersionInfo "1:68"
#define Module_FullVersion "1.69"
#define Module_HelpVersion "1.69 (11 Jan 2016)"
#define Module_LibraryVersionInfo "1:69"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment