Skip to content

Commit bb178eb

Browse files
authored
Merge pull request #8735 from dhalbert/no-rle-bmp
Reject RLE-compressed BMP files
2 parents cc9e8b3 + 71c9689 commit bb178eb

File tree

19 files changed

+63
-93
lines changed

19 files changed

+63
-93
lines changed

locale/circuitpython.pot

Lines changed: 36 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,19 @@ msgid ""
8989
msgstr ""
9090

9191
#: ports/atmel-samd/common-hal/alarm/__init__.c
92-
#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c
93-
#: ports/espressif/common-hal/rtc/RTC.c
92+
#: ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.c
93+
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
94+
#: ports/atmel-samd/common-hal/busio/SPI.c
95+
#: ports/cxd56/common-hal/analogio/AnalogOut.c
96+
#: ports/cxd56/common-hal/busio/SPI.c ports/cxd56/common-hal/rtc/RTC.c
97+
#: ports/espressif/common-hal/busio/SPI.c ports/espressif/common-hal/rtc/RTC.c
9498
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
99+
#: ports/mimxrt10xx/common-hal/busio/SPI.c
95100
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c
96-
#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c
97-
#: ports/raspberrypi/common-hal/alarm/__init__.c
101+
#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/busio/SPI.c
102+
#: ports/nrf/common-hal/rtc/RTC.c ports/raspberrypi/common-hal/alarm/__init__.c
98103
#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
104+
#: ports/raspberrypi/common-hal/busio/SPI.c
99105
#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c
100106
#: ports/stm/common-hal/canio/Listener.c ports/stm/common-hal/rtc/RTC.c
101107
#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audiobusio/PDMIn.c
@@ -112,6 +118,10 @@ msgstr ""
112118
msgid "%q and %q must be different"
113119
msgstr ""
114120

121+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
122+
msgid "%q and %q must share a clock unit"
123+
msgstr ""
124+
115125
#: shared-bindings/microcontroller/Pin.c
116126
msgid "%q contains duplicate pins"
117127
msgstr ""
@@ -206,6 +216,10 @@ msgstr ""
206216
msgid "%q must be array of type 'h'"
207217
msgstr ""
208218

219+
#: shared-bindings/audiobusio/PDMIn.c
220+
msgid "%q must be multiple of 8."
221+
msgstr ""
222+
209223
#: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c
210224
#: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c
211225
#: shared-module/synthio/Synthesizer.c
@@ -237,6 +251,10 @@ msgstr ""
237251
msgid "%q step cannot be zero"
238252
msgstr ""
239253

254+
#: shared-module/bitbangio/I2C.c
255+
msgid "%q too long"
256+
msgstr ""
257+
240258
#: py/bc.c py/objnamedtuple.c
241259
msgid "%q() takes %d positional arguments but %d were given"
242260
msgstr ""
@@ -415,12 +433,6 @@ msgstr ""
415433
msgid "3-arg pow() not supported"
416434
msgstr ""
417435

418-
#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c
419-
#: ports/atmel-samd/common-hal/countio/Counter.c
420-
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
421-
msgid "A hardware interrupt channel is already in use"
422-
msgstr ""
423-
424436
#: ports/espressif/common-hal/analogio/AnalogIn.c
425437
msgid "ADC2 is being used by WiFi"
426438
msgstr ""
@@ -591,14 +603,6 @@ msgstr ""
591603
msgid "Bit clock and word select must be sequential pins"
592604
msgstr ""
593605

594-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
595-
msgid "Bit clock and word select must share a clock unit"
596-
msgstr ""
597-
598-
#: shared-bindings/audiobusio/PDMIn.c
599-
msgid "Bit depth must be multiple of 8."
600-
msgstr ""
601-
602606
#: shared-bindings/bitmaptools/__init__.c
603607
msgid "Bitmap size and bits per value must match"
604608
msgstr ""
@@ -611,10 +615,6 @@ msgstr ""
611615
msgid "Both RX and TX required for flow control"
612616
msgstr ""
613617

614-
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
615-
msgid "Both pins must support hardware interrupts"
616-
msgstr ""
617-
618618
#: shared-bindings/displayio/Display.c
619619
#: shared-bindings/framebufferio/FramebufferDisplay.c
620620
msgid "Brightness not adjustable"
@@ -800,10 +800,6 @@ msgstr ""
800800
msgid "CircuitPython core code crashed hard. Whoops!\n"
801801
msgstr ""
802802

803-
#: shared-module/bitbangio/I2C.c
804-
msgid "Clock stretch too long"
805-
msgstr ""
806-
807803
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
808804
msgid "Clock unit in use"
809805
msgstr ""
@@ -921,9 +917,12 @@ msgstr ""
921917
msgid "ESP-IDF memory allocation failed"
922918
msgstr ""
923919

920+
#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c
921+
#: ports/atmel-samd/common-hal/countio/Counter.c
924922
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
925923
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
926924
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
925+
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
927926
#: ports/cxd56/common-hal/pulseio/PulseIn.c
928927
msgid "EXTINT channel already in use"
929928
msgstr ""
@@ -1076,13 +1075,6 @@ msgstr ""
10761075
msgid "Group already used"
10771076
msgstr ""
10781077

1079-
#: ports/atmel-samd/common-hal/busio/SPI.c ports/cxd56/common-hal/busio/SPI.c
1080-
#: ports/espressif/common-hal/busio/SPI.c
1081-
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c
1082-
#: ports/raspberrypi/common-hal/busio/SPI.c
1083-
msgid "Half duplex SPI is not implemented"
1084-
msgstr ""
1085-
10861078
#: supervisor/shared/safe_mode.c
10871079
msgid "Hard fault: memory access or instruction error."
10881080
msgstr ""
@@ -1339,10 +1331,6 @@ msgstr ""
13391331
msgid "Mapping must be a tuple"
13401332
msgstr ""
13411333

1342-
#: shared-bindings/audiobusio/PDMIn.c
1343-
msgid "Microphone startup delay must be in range 0.0 to 1.0"
1344-
msgstr ""
1345-
13461334
#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
13471335
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
13481336
msgid "Mismatched data size"
@@ -1512,10 +1500,15 @@ msgstr ""
15121500
msgid "No default %q bus"
15131501
msgstr ""
15141502

1503+
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
15151504
#: ports/atmel-samd/common-hal/touchio/TouchIn.c
15161505
msgid "No free GCLKs"
15171506
msgstr ""
15181507

1508+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
1509+
msgid "No free GLCKs"
1510+
msgstr ""
1511+
15191512
#: shared-bindings/os/__init__.c
15201513
msgid "No hardware random available"
15211514
msgstr ""
@@ -1705,10 +1698,6 @@ msgstr ""
17051698
msgid "Out-buffer elements must be <= 4 bytes long"
17061699
msgstr ""
17071700

1708-
#: shared-bindings/audiobusio/PDMIn.c
1709-
msgid "Oversample must be multiple of 8."
1710-
msgstr ""
1711-
17121701
#: shared-bindings/pwmio/PWMOut.c
17131702
msgid ""
17141703
"PWM frequency not writable when variable_frequency is False on construction."
@@ -1756,6 +1745,7 @@ msgid "Pin must be on PWM Channel B"
17561745
msgstr ""
17571746

17581747
#: ports/atmel-samd/common-hal/countio/Counter.c
1748+
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
17591749
msgid "Pin must support hardware interrupts"
17601750
msgstr ""
17611751

@@ -1832,6 +1822,10 @@ msgstr ""
18321822
msgid "RISE_AND_FALL not available on this chip"
18331823
msgstr ""
18341824

1825+
#: shared-module/displayio/OnDiskBitmap.c
1826+
msgid "RLE-compressed BMP not supported"
1827+
msgstr ""
1828+
18351829
#: ports/stm/common-hal/os/__init__.c
18361830
msgid "RNG DeInit Error"
18371831
msgstr ""
@@ -1892,10 +1886,6 @@ msgstr ""
18921886
msgid "Requested resource not found"
18931887
msgstr ""
18941888

1895-
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
1896-
msgid "Right channel unsupported"
1897-
msgstr ""
1898-
18991889
#: main.c
19001890
msgid "Running in safe mode! Not running saved code.\n"
19011891
msgstr ""
@@ -1993,10 +1983,6 @@ msgstr ""
19931983
msgid "Stereo right must be on PWM channel B"
19941984
msgstr ""
19951985

1996-
#: ports/raspberrypi/common-hal/wifi/Radio.c
1997-
msgid "Stopping AP is not supported."
1998-
msgstr ""
1999-
20001986
#: shared-bindings/alarm/time/TimeAlarm.c
20011987
msgid "Supply one of monotonic_time or epoch_time"
20021988
msgstr ""
@@ -2094,7 +2080,6 @@ msgstr ""
20942080
msgid "Total data to write is larger than %q"
20952081
msgstr ""
20962082

2097-
#: ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.c
20982083
#: ports/raspberrypi/common-hal/alarm/touch/TouchAlarm.c
20992084
#: ports/stm/common-hal/alarm/touch/TouchAlarm.c
21002085
msgid "Touch alarms not available"
@@ -2186,11 +2171,6 @@ msgstr ""
21862171
msgid "Unable to find I2C Display at %x"
21872172
msgstr ""
21882173

2189-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
2190-
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
2191-
msgid "Unable to find free GCLK"
2192-
msgstr ""
2193-
21942174
#: py/parse.c
21952175
msgid "Unable to init parser"
21962176
msgstr ""
@@ -2663,11 +2643,6 @@ msgstr ""
26632643
msgid "can't convert %q to %q"
26642644
msgstr ""
26652645

2666-
#: py/obj.c
2667-
#, c-format
2668-
msgid "can't convert %s to complex"
2669-
msgstr ""
2670-
26712646
#: py/objstr.c
26722647
msgid "can't convert '%q' object to %q implicitly"
26732648
msgstr ""
@@ -2676,18 +2651,10 @@ msgstr ""
26762651
msgid "can't convert complex to float"
26772652
msgstr ""
26782653

2679-
#: py/obj.c
2654+
#: py/obj.c py/runtime.c
26802655
msgid "can't convert to %q"
26812656
msgstr ""
26822657

2683-
#: py/obj.c
2684-
msgid "can't convert to complex"
2685-
msgstr ""
2686-
2687-
#: py/runtime.c
2688-
msgid "can't convert to int"
2689-
msgstr ""
2690-
26912658
#: py/objstr.c
26922659
msgid "can't convert to str implicitly"
26932660
msgstr ""

ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static void pinalarm_set_alarms_light(size_t n_alarms, const mp_obj_t *alarms) {
235235
case PINALARM_ERR_NOEXTINT:
236236
raise_ValueError_invalid_pin();
237237
case PINALARM_ERR_NOCHANNEL:
238-
mp_raise_RuntimeError(translate("A hardware interrupt channel is already in use"));
238+
mp_raise_RuntimeError(translate("EXTINT channel already in use"));
239239
default:
240240
mp_raise_RuntimeError(translate("Unknown reason."));
241241
}

ports/atmel-samd/common-hal/alarm/touch/TouchAlarm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
#include "shared-bindings/microcontroller/__init__.h"
2929

3030
void common_hal_alarm_touch_touchalarm_construct(alarm_touch_touchalarm_obj_t *self, const mcu_pin_obj_t *pin) {
31-
mp_raise_NotImplementedError(translate("Touch alarms not available"));
31+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_TouchAlarm);
3232
}

ports/atmel-samd/common-hal/audiobusio/I2SOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self,
157157
raise_ValueError_invalid_pin_name(MP_QSTR_word_select);
158158
}
159159
if (bc_clock_unit != ws_clock_unit) {
160-
mp_raise_ValueError(translate("Bit clock and word select must share a clock unit"));
160+
mp_raise_ValueError_varg(translate("%q and %q must share a clock unit"), MP_QSTR_bit_clock, MP_QSTR_word_select);
161161
}
162162
if (serializer == 0xff) {
163163
raise_ValueError_invalid_pin_name(MP_QSTR_data);
@@ -241,7 +241,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self,
241241
// Find a free GCLK to generate the MCLK signal.
242242
uint8_t gclk = find_free_gclk(divisor);
243243
if (gclk > GCLK_GEN_NUM) {
244-
mp_raise_RuntimeError(translate("Unable to find free GCLK"));
244+
mp_raise_RuntimeError(translate("No free GLCKs"));
245245
}
246246
self->gclk = gclk;
247247

ports/atmel-samd/common-hal/audiobusio/PDMIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self,
195195
// Find a free GCLK to generate the MCLK signal.
196196
uint8_t gclk = find_free_gclk(clock_divisor);
197197
if (gclk > GCLK_GEN_NUM) {
198-
mp_raise_RuntimeError(translate("Unable to find free GCLK"));
198+
mp_raise_RuntimeError(translate("No free GCLKs"));
199199
}
200200
self->gclk = gclk;
201201

ports/atmel-samd/common-hal/audioio/AudioOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self,
133133
}
134134
#ifdef SAMD21
135135
if (right_channel != NULL) {
136-
mp_raise_ValueError(translate("Right channel unsupported"));
136+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_right_channel);
137137
}
138138
if (left_channel != &pin_PA02) {
139139
raise_ValueError_invalid_pin();

ports/atmel-samd/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
5959
uint8_t dopo = 255;
6060

6161
if (half_duplex) {
62-
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
62+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_half_duplex);
6363
}
6464

6565
// Ensure the object starts in its deinit state.

ports/atmel-samd/common-hal/countio/Counter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void common_hal_countio_counter_construct(countio_counter_obj_t *self,
1818

1919
if (eic_get_enable()) {
2020
if (!eic_channel_free(pin->extint_channel)) {
21-
mp_raise_RuntimeError(translate("A hardware interrupt channel is already in use"));
21+
mp_raise_RuntimeError(translate("EXTINT channel already in use"));
2222
}
2323
} else {
2424
turn_on_external_interrupt_controller();

ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t *self,
3939
const mcu_pin_obj_t *pin_a, const mcu_pin_obj_t *pin_b) {
4040
if (!pin_a->has_extint || !pin_b->has_extint) {
41-
mp_raise_RuntimeError(translate("Both pins must support hardware interrupts"));
41+
mp_raise_RuntimeError(translate("Pin must support hardware interrupts"));
4242
}
4343

4444
// TODO: The SAMD51 has a peripheral dedicated to quadrature encoder debugging. Use it instead
4545
// of the external interrupt.
4646

4747
if (eic_get_enable()) {
4848
if (!eic_channel_free(pin_a->extint_channel) || !eic_channel_free(pin_b->extint_channel)) {
49-
mp_raise_RuntimeError(translate("A hardware interrupt channel is already in use"));
49+
mp_raise_RuntimeError(translate("EXTINT channel already in use"));
5050
}
5151
} else {
5252
turn_on_external_interrupt_controller();

ports/cxd56/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *
4040
int port = -1;
4141

4242
if (half_duplex) {
43-
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
43+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_half_duplex);
4444
}
4545

4646
if (clock->number == PIN_SPI4_SCK &&

ports/espressif/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
8888
};
8989

9090
if (half_duplex) {
91-
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
91+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_half_duplex);
9292
}
9393

9494
for (spi_host_device_t host_id = SPI2_HOST; host_id < SOC_SPI_PERIPH_NUM; host_id++) {

ports/mimxrt10xx/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
9999
bool spi_taken = false;
100100

101101
if (half_duplex) {
102-
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
102+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_half_duplex);
103103
}
104104

105105
for (uint i = 0; i < sck_count; i++) {

ports/nrf/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static nrf_spim_frequency_t baudrate_to_spim_frequency(const uint32_t baudrate)
146146
void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso, bool half_duplex) {
147147

148148
if (half_duplex) {
149-
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
149+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_half_duplex);
150150
}
151151

152152
// Find a free instance, with most desirable (highest freq and not shared) allocated first.

ports/raspberrypi/common-hal/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
5858
size_t instance_index = NO_INSTANCE;
5959

6060
if (half_duplex) {
61-
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
61+
mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_half_duplex);
6262
}
6363

6464
if (clock->number % 4 == 2) {

0 commit comments

Comments
 (0)