void-packages/srcpkgs/cdparanoia/patches/byteswap-null-check.diff
Ryan Farley 2e0ede5b95 libcdparanoia: byteswap null check
From upstream r15356, fixes a segfault when attempting to read discs
2021-09-13 22:26:11 +02:00

13 lines
467 B
Diff

Index: interface/interface.c
===================================================================
--- a/interface/interface.c (revision 15338)
+++ b/interface/interface.c (revision 15356)
@@ -118,7 +118,7 @@
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;