if(p1 == 0) { //Escape code
p2 = bytestream2_get_byte(gb);
if(p2 == 0) { //End-of-line
- output = pic->data[0] + (--line) * pic->linesize[0];
- if (line < 0) {
+ if (--line < 0) {
if (bytestream2_get_be16(gb) == 1) { // end-of-picture
return 0;
} else {
return AVERROR_INVALIDDATA;
}
}
+ output = pic->data[0] + line * pic->linesize[0];
pos = 0;
continue;
} else if(p2 == 1) { //End-of-picture