shithub: opus-tools

Download patch

ref: 93a4bc48cad80abb95bb50765ee776d11b014391
parent: a83af858c98094dfc6fed1d16585bb5e800b456d
parent: bb045db2b479504702bf1f570476e2c3f0ceb678
author: qwx <qwx@sciops.net>
date: Sun Apr 20 18:07:06 EDT 2025

merge

--- a/src/flac.c
+++ b/src/flac.c
@@ -80,7 +80,7 @@
   flacfile *flac;
   (void)decoder;
   flac=(flacfile *)client_data;
-  return feof(flac->f)?true:false;
+  return flac->bufpos>=flac->buflen&&feof(flac->f)?true:false;
 }
 
 /*Callback to process a metadata packet.*/
@@ -292,6 +292,7 @@
   if(len<4)return 0;
   /*Normal FLAC.*/
   if(!memcmp(buf,"fLaC",4))return 1;
+  if(len<14)return 0;
   if(!memcmp(buf,"ID3",3)){
     int i;
     int id3_len = 0;
--