comparison mpegvideo.c @ 1002:e89b11e07ee7 libavcodec

gmc1 segfault fix (found by kabi)
author michaelni
date Mon, 13 Jan 2003 12:55:05 +0000
parents 6129c88a6393
children b2cf2a1d9a51
comparison
equal deleted inserted replaced
1001:95cbffdc98a9 1002:e89b11e07ee7
1292 1292
1293 ptr = ref_picture[0] + (src_y * linesize) + src_x + src_offset; 1293 ptr = ref_picture[0] + (src_y * linesize) + src_x + src_offset;
1294 1294
1295 dest_y+=dest_offset; 1295 dest_y+=dest_offset;
1296 if(s->flags&CODEC_FLAG_EMU_EDGE){ 1296 if(s->flags&CODEC_FLAG_EMU_EDGE){
1297 if(src_x<0 || src_y<0 || src_x + (motion_x&15) + 16 > s->h_edge_pos 1297 if(src_x<0 || src_y<0 || src_x + 17 >= s->h_edge_pos
1298 || src_y + (motion_y&15) + 16 > s->v_edge_pos){ 1298 || src_y + 17 >= s->v_edge_pos){
1299 ff_emulated_edge_mc(s, ptr, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos); 1299 ff_emulated_edge_mc(s, ptr, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
1300 ptr= s->edge_emu_buffer; 1300 ptr= s->edge_emu_buffer;
1301 emu=1;
1302 } 1301 }
1303 } 1302 }
1304 1303
1305 if((motion_x|motion_y)&7){ 1304 if((motion_x|motion_y)&7){
1306 s->dsp.gmc1(dest_y , ptr , linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding); 1305 s->dsp.gmc1(dest_y , ptr , linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
1331 if (src_y == s->height>>1) 1330 if (src_y == s->height>>1)
1332 motion_y =0; 1331 motion_y =0;
1333 1332
1334 offset = (src_y * uvlinesize) + src_x + (src_offset>>1); 1333 offset = (src_y * uvlinesize) + src_x + (src_offset>>1);
1335 ptr = ref_picture[1] + offset; 1334 ptr = ref_picture[1] + offset;
1336 if(emu){ 1335 if(s->flags&CODEC_FLAG_EMU_EDGE){
1337 ff_emulated_edge_mc(s, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1); 1336 if(src_x<0 || src_y<0 || src_x + 9 >= s->h_edge_pos>>1
1338 ptr= s->edge_emu_buffer; 1337 || src_y + 9 >= s->v_edge_pos>>1){
1338 ff_emulated_edge_mc(s, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
1339 ptr= s->edge_emu_buffer;
1340 emu=1;
1341 }
1339 } 1342 }
1340 s->dsp.gmc1(dest_cb + (dest_offset>>1), ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding); 1343 s->dsp.gmc1(dest_cb + (dest_offset>>1), ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
1341 1344
1342 ptr = ref_picture[2] + offset; 1345 ptr = ref_picture[2] + offset;
1343 if(emu){ 1346 if(emu){