Bug 814296 - Fix infinite loop when trying to play a zero-length MPEG4 file in omx-plugin r=doublec

This commit is contained in:
Edwin Flores 2013-01-08 11:03:47 +13:00
parent dd8f473d13
commit d81778f9b0

View File

@ -84,6 +84,11 @@ ssize_t MediaStreamSource::readAt(MOZ_STAGEFRIGHT_OFF_T offset, void *data, size
if (!mPluginHost->Read(mDecoder, ptr, offset, todo, &bytesRead)) {
return ERROR_IO;
}
if (bytesRead == 0) {
return size - todo;
}
offset += bytesRead;
todo -= bytesRead;
ptr += bytesRead;