comparison h264.c @ 4620:f23c20cf7579 libavcodec

check for no frame and prevent segfault
author michael
date Sat, 03 Mar 2007 21:33:33 +0000
parents 8036b117ae26
children f7c444dc3b04
comparison
equal deleted inserted replaced
4619:9358bf66a1d0 4620:f23c20cf7579
8353 8353
8354 buf_index=decode_nal_units(h, buf, buf_size); 8354 buf_index=decode_nal_units(h, buf, buf_size);
8355 if(buf_index < 0) 8355 if(buf_index < 0)
8356 return -1; 8356 return -1;
8357 8357
8358 if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
8359 av_log(avctx, AV_LOG_ERROR, "no frame!\n");
8360 return -1;
8361 }
8362
8358 if(!(s->flags2 & CODEC_FLAG2_CHUNKS) || (s->mb_y >= s->mb_height && s->mb_height)){ 8363 if(!(s->flags2 & CODEC_FLAG2_CHUNKS) || (s->mb_y >= s->mb_height && s->mb_height)){
8359 Picture *out = s->current_picture_ptr; 8364 Picture *out = s->current_picture_ptr;
8360 Picture *cur = s->current_picture_ptr; 8365 Picture *cur = s->current_picture_ptr;
8361 Picture *prev = h->delayed_output_pic; 8366 Picture *prev = h->delayed_output_pic;
8362 int i, pics, cross_idr, out_of_order, out_idx; 8367 int i, pics, cross_idr, out_of_order, out_idx;