aboutsummaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
blob: 682cf6e0335981a672d122ac82839d093192222e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From c760c5d31f2412a5be5ac6896e6069d1cea08527 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 26 Jun 2017 22:31:45 -0700
Subject: [PATCH 1/2] check for null buffer before trying a byteswap

Author: Monty <paranoia@xiph.org>

Patch from debian
http://sources.debian.net/src/cdparanoia/3.10.2%2Bdebian-11/debian/patches/04-endian.patch

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 interface/interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/interface/interface.c b/interface/interface.c
index 526c2a9..763a0ea 100644
--- a/interface/interface.c
+++ b/interface/interface.c
@@ -118,7 +118,7 @@ long cdda_read_timed(cdrom_drive *d, void *buffer, long beginsector, long sector
 	if(d->bigendianp==-1) /* not determined yet */
 	  d->bigendianp=data_bigendianp(d);
 	
-	if(d->bigendianp!=bigendianp()){
+	if(buffer && d->bigendianp!=bigendianp()){
 	  int i;
 	  u_int16_t *p=(u_int16_t *)buffer;
 	  long els=sectors*CD_FRAMESIZE_RAW/2;
-- 
2.13.2