1From c760c5d31f2412a5be5ac6896e6069d1cea08527 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 26 Jun 2017 22:31:45 -0700
4Subject: [PATCH 1/2] check for null buffer before trying a byteswap
5
6Author: Monty <paranoia@xiph.org>
7
8Patch from debian
9http://sources.debian.net/src/cdparanoia/3.10.2%2Bdebian-11/debian/patches/04-endian.patch
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 interface/interface.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/interface/interface.c b/interface/interface.c
17index 526c2a9..763a0ea 100644
18--- a/interface/interface.c
19+++ b/interface/interface.c
20@@ -118,7 +118,7 @@ long cdda_read_timed(cdrom_drive *d, void *buffer, long beginsector, long sector
21 	if(d->bigendianp==-1) /* not determined yet */
22 	  d->bigendianp=data_bigendianp(d);
23
24-	if(d->bigendianp!=bigendianp()){
25+	if(buffer && d->bigendianp!=bigendianp()){
26 	  int i;
27 	  u_int16_t *p=(u_int16_t *)buffer;
28 	  long els=sectors*CD_FRAMESIZE_RAW/2;
29--
302.13.2
31
32