shithub: libopusenc

Download patch

ref: fe51d9c3de611d3a04f20ee4d8c3a432c12e0978
parent: bdf3369e85901c3d446786c8d42e1962111278d8
author: Mark Harris <[email protected]>
date: Fri Dec 29 05:31:59 EST 2017

Relax JPEG check to allow EXIF metadata

Signed-off-by: Jean-Marc Valin <[email protected]>

--- a/src/picture.c
+++ b/src/picture.c
@@ -106,8 +106,7 @@
 }
 
 static int is_jpeg(const unsigned char *buf, size_t length){
-  return length>=11&&memcmp(buf,"\xFF\xD8\xFF\xE0",4)==0
-   &&(buf[4]<<8|buf[5])>=16&&memcmp(buf+6,"JFIF",5)==0;
+  return length>=3&&memcmp(buf,"\xFF\xD8\xFF",3)==0;
 }
 
 static int is_png(const unsigned char *buf, size_t length){