Commit 7cea5357 authored by Max Kellermann's avatar Max Kellermann

faad: check the result of adts_find_frame()

Instead of checking if the buffer is empty after adts_find_frame(), check adts_find_frame()'s return value. This is more robust.
parent 77db32f8
......@@ -392,10 +392,8 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
file_time = 0.0;
do {
adts_find_frame(&buffer);
faad_buffer_fill(&buffer);
if (buffer.length == 0)
size_t frame_size = adts_find_frame(&buffer);
if (frame_size == 0)
break;
decoded = faad_decoder_decode(decoder, &buffer, &frame_info);
......
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