Mercurial > libavcodec.hg
comparison dca.c @ 5645:abf90ea2c392 libavcodec
Set data_size to zero when DCA header parse failed
Patch by Limin Wang <lance('\\'>>1)lmwang>(0x24^'D')<gmail>('/' & 0xFE)<com>
Thread [PATCH] set data_size to zero if failed to parse dca header
author | kostya |
---|---|
date | Thu, 06 Sep 2007 14:55:13 +0000 |
parents | 1a92e129a679 |
children | ae05d6d12f12 |
comparison
equal
deleted
inserted
replaced
5644:679d6ccfffb0 | 5645:abf90ea2c392 |
---|---|
1149 } | 1149 } |
1150 | 1150 |
1151 init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8); | 1151 init_get_bits(&s->gb, s->dca_buffer, s->dca_buffer_size * 8); |
1152 if (dca_parse_frame_header(s) < 0) { | 1152 if (dca_parse_frame_header(s) < 0) { |
1153 //seems like the frame is corrupt, try with the next one | 1153 //seems like the frame is corrupt, try with the next one |
1154 *data_size=0; | |
1154 return buf_size; | 1155 return buf_size; |
1155 } | 1156 } |
1156 //set AVCodec values with parsed data | 1157 //set AVCodec values with parsed data |
1157 avctx->sample_rate = s->sample_rate; | 1158 avctx->sample_rate = s->sample_rate; |
1158 avctx->bit_rate = s->bit_rate; | 1159 avctx->bit_rate = s->bit_rate; |