shithub: opusfile

Download patch

ref: 933157f174ed5c7313b583bf9352c3fc28d57ba9
parent: ee911775715d0b3721938cad2e21823fe4b19bd7
author: Timothy B. Terriberry <[email protected]>
date: Tue Mar 25 12:33:42 EDT 2014

Fix METADATA_BLOCK_PICTURE check for all-0 params.

width=height=depth=colors=0 should be allowed, but wasn't thanks to
 some missing parentheses.
Thanks to Lithopsian for the report.

--- a/src/info.c
+++ b/src/info.c
@@ -564,7 +564,7 @@
   i+=4;
   /*If one of these is set, they all must be, but colors==0 is a valid value.*/
   colors_set=width!=0||height!=0||depth!=0||colors!=0;
-  if(width==0||height==0||depth==0&&colors_set)return OP_ENOTFORMAT;
+  if((width==0||height==0||depth==0)&&colors_set)return OP_ENOTFORMAT;
   data_length=op_parse_uint32be(_buf+i);
   i+=4;
   if(data_length>_buf_sz-i)return OP_ENOTFORMAT;