comparison mjpeg.c @ 226:5784987c3940 libavcodec

width or height %16 != 0 bugfix
author michaelni
date Thu, 07 Feb 2002 02:08:36 +0000
parents 0b09bd08ef4b
children f418b5c5ff67
comparison
equal deleted inserted replaced
225:ae145876789d 226:5784987c3940
618 s->interlaced = 1; 618 s->interlaced = 1;
619 s->bottom_field = 0; 619 s->bottom_field = 0;
620 } 620 }
621 621
622 for(i=0;i<nb_components;i++) { 622 for(i=0;i<nb_components;i++) {
623 int w, h, hh, vv; 623 int w, h;
624 hh = s->h_max / s->h_count[i]; 624 w = (s->width + 8 * s->h_max - 1) / (8 * s->h_max);
625 vv = s->v_max / s->v_count[i]; 625 h = (s->height + 8 * s->v_max - 1) / (8 * s->v_max);
626 w = (s->width + 8 * hh - 1) / (8 * hh); 626 w = w * 8 * s->h_count[i];
627 h = (s->height + 8 * vv - 1) / (8 * vv); 627 h = h * 8 * s->v_count[i];
628 w = w * 8;
629 h = h * 8;
630 if (s->interlaced) 628 if (s->interlaced)
631 w *= 2; 629 w *= 2;
632 s->linesize[i] = w; 630 s->linesize[i] = w;
633 /* memory test is done in mjpeg_decode_sos() */ 631 /* memory test is done in mjpeg_decode_sos() */
634 s->current_picture[i] = av_mallocz(w * h); 632 s->current_picture[i] = av_mallocz(w * h);