avcodec/loco: Check loco_get_rice() for failure

Fixes: CID1604495 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d553276843)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 8 months ago
parent 41c5289c7e
commit 21d7ac3a07
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      libavcodec/loco.c

@ -157,6 +157,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
/* restore top left pixel */
val = loco_get_rice(&rc);
if (val == INT_MIN)
return AVERROR_INVALIDDATA;
data[0] = 128 + val;
/* restore top line */
for (i = 1; i < width; i++) {

Loading…
Cancel
Save