for (j = 1; j < height; j++) {
out = 0;
+ if (get_bits_left(&ctx->gb) <= 0)
+ return AVERROR_INVALIDDATA;
while (out < width) {
int c = ir2_get_code(&ctx->gb);
if (c >= 0x80) { /* we have a skip */
for (j = 0; j < height; j++) {
out = 0;
+ if (get_bits_left(&ctx->gb) <= 0)
+ return AVERROR_INVALIDDATA;
while (out < width) {
c = ir2_get_code(&ctx->gb);
if (c >= 0x80) { /* we have a skip */