61 int buf_size = avpkt->
size;
63 const unsigned char *encoded =
buf;
64 unsigned char *pixptr, *pixptr_end;
66 unsigned int dlen, p, row;
67 const unsigned char *lp, *dp;
69 unsigned int planes = c->
planes;
70 unsigned char *planemap = c->
planemap;
77 dp = encoded + planes * (height << 1);
79 for (p = 0; p < planes; p++) {
81 lp = encoded + p * (height << 1);
84 for (row = 0; row <
height; row++) {
85 pixptr = frame->
data[0] + row * frame->
linesize[0] + planemap[p];
86 pixptr_end = pixptr + frame->
linesize[0];
87 if(lp - encoded + row*2 + 1 >= buf_size)
89 dlen =
av_be2ne16(*(
const unsigned short *)(lp + row * 2));
92 if (dp + 1 >= buf + buf_size)
94 if ((count = *dp++) <= 127) {
97 if (pixptr + count * planes > pixptr_end)
99 if (dp + count > buf + buf_size)
107 if (pixptr + count * planes > pixptr_end)