comparison bmp.c @ 4432:a848b652f0ac libavcodec

Fix segfault in bmp decoder. Patch by Michel Bardiaux mbardiaux mediaxim dot be.
author takis
date Mon, 29 Jan 2007 14:07:12 +0000
parents f792b146869b
children 3af19e140d67
comparison
equal deleted inserted replaced
4431:85ac154efd99 4432:a848b652f0ac
156 if(avctx->pix_fmt == PIX_FMT_NONE){ 156 if(avctx->pix_fmt == PIX_FMT_NONE){
157 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n"); 157 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
158 return -1; 158 return -1;
159 } 159 }
160 160
161 if(p->data[0])
162 avctx->release_buffer(avctx, p);
163
161 p->reference = 0; 164 p->reference = 0;
162 if(avctx->get_buffer(avctx, p) < 0){ 165 if(avctx->get_buffer(avctx, p) < 0){
163 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); 166 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
164 return -1; 167 return -1;
165 } 168 }