65 const uint8_t *buf = avpkt->
data;
66 int buf_size = avpkt->
size;
68 const unsigned char *encoded = buf;
69 unsigned char *pixptr, *pixptr_end;
71 unsigned int dlen, p, row;
72 const unsigned char *lp, *dp, *ep;
75 unsigned int planes = c->
planes;
76 unsigned char *planemap = c->
planemap;
88 ep = encoded + buf_size;
91 dp = encoded + planes * (height << 1);
99 for (p = 0; p < planes; p++) {
101 lp = encoded + p * (height << 1);
104 for(row = 0; row <
height; row++) {
107 if (ep - lp < row * 2 + 2)
109 dlen =
av_be2ne16(*(
const unsigned short *)(lp+row*2));
112 if(ep - dp <= 1)
return -1;
113 if ((count = *dp++) <= 127) {
116 if (pixptr + count * px_inc > pixptr_end)
118 if(ep - dp < count)
return -1;
125 if (pixptr + count * px_inc > pixptr_end)