diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 9a309fd063..e3746c8317 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -159,6 +159,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh for (j = 1; j < height; j++) { /* restore left column */ val = loco_get_rice(&rc); + if (val == INT_MIN) + return AVERROR_INVALIDDATA; data[0] = data[-stride] + val; /* restore all other pixels */ for (i = 1; i < width; i++) {