Mercurial > audlegacy-plugins
comparison src/madplug/decoder.c @ 783:83a38bcfe7c8 trunk
[svn] - check the result of vfs_fread() strictly.
| author | yaz |
|---|---|
| date | Mon, 05 Mar 2007 00:48:01 -0800 |
| parents | 209b08a3eff6 |
| children | 5ddfe9eac8ee |
comparison
equal
deleted
inserted
replaced
| 782:6f519e34ddf0 | 783:83a38bcfe7c8 |
|---|---|
| 193 g_message("scan_file frames = %d", info->frames); | 193 g_message("scan_file frames = %d", info->frames); |
| 194 #endif /* DEBUG */ | 194 #endif /* DEBUG */ |
| 195 | 195 |
| 196 while (1) { | 196 while (1) { |
| 197 remainder = stream.bufend - stream.next_frame; | 197 remainder = stream.bufend - stream.next_frame; |
| 198 | 198 |
| 199 /* | 199 /* |
| 200 if (remainder >= BUFFER_SIZE) | 200 if (remainder >= BUFFER_SIZE) |
| 201 { | 201 { |
| 202 printf("oh dear.. remainder = %d\n", remainder); | 202 printf("oh dear.. remainder = %d\n", remainder); |
| 203 } | 203 } |
| 209 | 209 |
| 210 if (len <= 0) { | 210 if (len <= 0) { |
| 211 #ifdef DEBUG | 211 #ifdef DEBUG |
| 212 g_message("scan_file: len <= 0 abort."); | 212 g_message("scan_file: len <= 0 abort."); |
| 213 #endif | 213 #endif |
| 214 break; | 214 return 0; |
| 215 } | 215 } |
| 216 | 216 |
| 217 mad_stream_buffer(&stream, buffer, len + remainder); | 217 mad_stream_buffer(&stream, buffer, len + remainder); |
| 218 | 218 |
| 219 while (!fast || (fast && info->frames < N_AVERAGE_FRAMES)) { | 219 while (!fast || (fast && info->frames < N_AVERAGE_FRAMES)) { |
