mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(jpeg): JPEG can encode and decode in encryption situation
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_check.h"
|
||||
#include "hal/jpeg_periph.h"
|
||||
#include "esp_psram.h"
|
||||
#if JPEG_USE_RETENTION_LINK
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#endif
|
||||
@@ -257,3 +258,17 @@ esp_err_t jpeg_check_intr_priority(jpeg_codec_handle_t jpeg_codec, int intr_prio
|
||||
ESP_RETURN_ON_FALSE(!intr_priority_conflict, ESP_ERR_INVALID_STATE, TAG, "intr_priority conflict, already is %d but attempt to %d", jpeg_codec->intr_priority, intr_priority);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool jpeg_check_dma2d_buffer(const void *buffer)
|
||||
{
|
||||
#if CONFIG_SECURE_FLASH_ENC_ENABLED
|
||||
// jpeg cannot handle encrypted data.
|
||||
if (esp_ptr_external_ram(buffer) && !esp_psram_ptr_is_no_enc(buffer)) {
|
||||
return false;
|
||||
}
|
||||
if (esp_ptr_in_drom(buffer)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user