Originally committed as revision 23559 to svn://svn.ffmpeg.org/ffmpeg/trunk
Benoit Fouet authored on 2010/06/10 15:00:37... | ... |
@@ -29,8 +29,8 @@ typedef struct H264BSFContext { |
29 | 29 |
} H264BSFContext; |
30 | 30 |
|
31 | 31 |
static int alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size, |
32 |
- const uint8_t *sps_pps, uint32_t sps_pps_size, |
|
33 |
- const uint8_t *in, uint32_t in_size) { |
|
32 |
+ const uint8_t *sps_pps, uint32_t sps_pps_size, |
|
33 |
+ const uint8_t *in, uint32_t in_size) { |
|
34 | 34 |
uint32_t offset = *poutbuf_size; |
35 | 35 |
uint8_t nal_header_size = offset ? 3 : 4; |
36 | 36 |
void *tmp; |
... | ... |
@@ -95,7 +95,8 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, |
95 | 95 |
|
96 | 96 |
unit_size = AV_RB16(extradata); |
97 | 97 |
total_size += unit_size+4; |
98 |
- if (total_size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE || extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { |
|
98 |
+ if (total_size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE || |
|
99 |
+ extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { |
|
99 | 100 |
av_free(out); |
100 | 101 |
return AVERROR(EINVAL); |
101 | 102 |
} |
... | ... |
@@ -143,13 +144,13 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, |
143 | 143 |
/* prepend only to the first type 5 NAL unit of an IDR picture */ |
144 | 144 |
if (ctx->first_idr && unit_type == 5) { |
145 | 145 |
if (alloc_and_copy(poutbuf, poutbuf_size, |
146 |
- avctx->extradata, avctx->extradata_size, |
|
146 |
+ avctx->extradata, avctx->extradata_size, |
|
147 | 147 |
buf, nal_size) < 0) |
148 | 148 |
goto fail; |
149 | 149 |
ctx->first_idr = 0; |
150 | 150 |
} else { |
151 | 151 |
if (alloc_and_copy(poutbuf, poutbuf_size, |
152 |
- NULL, 0, |
|
152 |
+ NULL, 0, |
|
153 | 153 |
buf, nal_size) < 0) |
154 | 154 |
goto fail; |
155 | 155 |
if (!ctx->first_idr && unit_type == 1) |