Revision 1cd89f27

View differences:

libavcodec/pnm.c
198 198
    do_read:
199 199
        ptr = p->data[0];
200 200
        linesize = p->linesize[0];
201
        if(s->bytestream + n*avctx->height > s->bytestream_end)
202
            return -1;
201 203
        for(i = 0; i < avctx->height; i++) {
202 204
            memcpy(ptr, s->bytestream, n);
203 205
            s->bytestream += n;
......
211 213
            n = avctx->width;
212 214
            ptr = p->data[0];
213 215
            linesize = p->linesize[0];
216
            if(s->bytestream + n*avctx->height*3/2 > s->bytestream_end)
217
                return -1;
214 218
            for(i = 0; i < avctx->height; i++) {
215 219
                memcpy(ptr, s->bytestream, n);
216 220
                s->bytestream += n;
......
233 237
    case PIX_FMT_RGBA32:
234 238
        ptr = p->data[0];
235 239
        linesize = p->linesize[0];
240
        if(s->bytestream + avctx->width*avctx->height*4 > s->bytestream_end)
241
            return -1;
236 242
        for(i = 0; i < avctx->height; i++) {
237 243
            int j, r, g, b, a;
238 244

  

Also available in: Unified diff