mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
rbutil: Fix crash on sansapatcher access.
We now initialize sectorbuf explicitly, and there are situation where it wasn't initialized explicitly. Change-Id: I35516a1fa7326c0861885ffa058737de19285c2c
This commit is contained in:
parent
1ff11b627b
commit
5c7b0e071f
1 changed files with 7 additions and 5 deletions
|
|
@ -43,11 +43,7 @@ BootloaderInstallSansa::~BootloaderInstallSansa()
|
||||||
*/
|
*/
|
||||||
bool BootloaderInstallSansa::install(void)
|
bool BootloaderInstallSansa::install(void)
|
||||||
{
|
{
|
||||||
// initialize sector buffer. The sector buffer is part of the sansa_t
|
sansaInitialize(&sansa);
|
||||||
// structure, so a second instance of this class will have its own buffer.
|
|
||||||
if(sansa.sectorbuf == nullptr) {
|
|
||||||
sansa_alloc_buffer(&sansa, BUFFER_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sansa.sectorbuf == nullptr) {
|
if(sansa.sectorbuf == nullptr) {
|
||||||
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
|
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
|
||||||
|
|
@ -236,6 +232,12 @@ BootloaderInstallBase::BootloaderType BootloaderInstallSansa::installed(void)
|
||||||
|
|
||||||
bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa)
|
bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa)
|
||||||
{
|
{
|
||||||
|
// initialize sector buffer. The sector buffer is part of the sansa_t
|
||||||
|
// structure, so a second instance of this class will have its own buffer.
|
||||||
|
if(sansa->sectorbuf == nullptr) {
|
||||||
|
sansa_alloc_buffer(sansa, BUFFER_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
if(!m_blfile.isEmpty()) {
|
if(!m_blfile.isEmpty()) {
|
||||||
QString devicename = Utils::resolveDevicename(m_blfile);
|
QString devicename = Utils::resolveDevicename(m_blfile);
|
||||||
if(devicename.isEmpty()) {
|
if(devicename.isEmpty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue