Commit 9e37d05a authored by Josh Coalson's avatar Josh Coalson
Browse files

fix bug where plugin would crash if decoder hits unexpected end of file

parent afd2e2d0
......@@ -276,9 +276,12 @@ DWORD WINAPI __stdcall DecodeThread(void *b)
done = 1;
break;
}
else if(!FLAC__file_decoder_process_one_frame(decoder_))
else if(!FLAC__file_decoder_process_one_frame(decoder_)) {
MessageBox(mod_.hMainWindow, FLAC__FileDecoderStateString[FLAC__file_decoder_get_state(decoder_)], "READ ERROR processing frame", 0);
done = 1;
break;
}
}
if (samples_in_reservoir_ == 0) {
done = 1;
......
......@@ -152,9 +152,12 @@ int FlacPcm::processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswit
eof = true;
break;
}
else if(!FLAC__seekable_stream_decoder_process_one_frame(decoder))
else if(!FLAC__seekable_stream_decoder_process_one_frame(decoder)) {
//@@@ how to do this? MessageBox(mod_.hMainWindow, FLAC__FileDecoderStateString[FLAC__file_decoder_get_state(decoder_)], "READ ERROR processing frame", 0);
eof = true;
break;
}
}
if(samples_in_reservoir == 0) {
eof = true;
......
......@@ -307,9 +307,13 @@ void *play_loop_(void *arg)
file_info_.eof = true;
break;
}
else if(!FLAC__file_decoder_process_one_frame(decoder_))
else if(!FLAC__file_decoder_process_one_frame(decoder_)) {
/*@@@ this should probably be a dialog */
fprintf(stderr, "libxmms-flac: READ ERROR processing frame\n");
file_info_.eof = true;
break;
}
}
if(reservoir_samples_ > 0) {
const unsigned channels = file_info_.channels;
const unsigned bytes_per_sample = (file_info_.bits_per_sample+7)/8;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment