micropython 273 B

12345678910111213141516171819
  1. commit 1868de0b8710f10574a17e0f8e517105f608fd63
  2. Author: Oliver Fabel <28701799+ofabel@users.noreply.github.com>
  3. Date: Sat Sep 7 21:07:44 2024 +0200
  4. library update
  5. diff --git a/mp_flipper_modflipperzero.c b/mp_flipper_modflipperzero.c
  6. index cb7de86e2..a27f3c98e 100644
  7. --- a/mp_flipper_modflipperzero.c
  8. +++ b/mp_flipper_modflipperzero.c
  9. @@ -580,7 +580,7 @@ static mp_obj_t flipperzero_infrared_receive(size_t n_args, const mp_obj_t* args
  10. size_t length = 0;
  11. uint32_t* buffer = mp_flipper_infrared_receive(timeout, &length);
  12. - mp_obj_t* signal = malloc(length * sizeof(mp_obj_t));
  13. + mp_obj_t* signal = length > 0 ? malloc(length * sizeof(mp_obj_t)) : NULL;
  14. for(uint16_t i = 0; i < length; i++) {
  15. signal[i] = mp_obj_new_int(buffer[i]);