shithub: opus-tools

Download patch

ref: 2fdb85b5752513848ce91eb25fda4a5af473974e
parent: a638dfa37bd857e14b088e0ccade701dc6aafc79
author: Mark Harris <mark.hsj@gmail.com>
date: Thu Dec 28 13:37:57 EST 2017

opusinfo: Relax JPEG check to allow EXIF metadata

--- a/src/picture.c
+++ b/src/picture.c
@@ -105,8 +105,7 @@
 }
 
 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;
 }
 
 int is_png(const unsigned char *buf, size_t length){