avcodec/shorten: Fix discard of ‘const’ qualifier
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
507c2a5774
commit
8060644237
@ -563,7 +563,6 @@ static int shorten_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
buf = &s->bitstream[s->bitstream_index];
|
buf = &s->bitstream[s->bitstream_index];
|
||||||
buf_size += s->bitstream_size;
|
buf_size += s->bitstream_size;
|
||||||
s->bitstream_size = buf_size;
|
s->bitstream_size = buf_size;
|
||||||
memset(buf + buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
|
|
||||||
|
|
||||||
/* do not decode until buffer has at least max_framesize bytes or
|
/* do not decode until buffer has at least max_framesize bytes or
|
||||||
* the end of the file has been reached */
|
* the end of the file has been reached */
|
||||||
@ -583,10 +582,9 @@ static int shorten_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (avpkt->size) {
|
if (avpkt->size) {
|
||||||
int max_framesize;
|
int max_framesize = s->blocksize * s->channels * 8;
|
||||||
void *tmp_ptr;
|
void *tmp_ptr;
|
||||||
|
|
||||||
max_framesize = FFMAX(s->max_framesize, s->blocksize * s->channels * 8);
|
|
||||||
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
|
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
|
||||||
max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
|
max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!tmp_ptr) {
|
if (!tmp_ptr) {
|
||||||
@ -594,7 +592,10 @@ static int shorten_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
s->bitstream = tmp_ptr;
|
s->bitstream = tmp_ptr;
|
||||||
s->max_framesize = max_framesize;
|
if (max_framesize > s->max_framesize)
|
||||||
|
memset(s->bitstream + s->max_framesize, 0, (max_framesize - s->max_framesize) +
|
||||||
|
AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
s->max_framesize = FFMAX(s->max_framesize, max_framesize);
|
||||||
*got_frame_ptr = 0;
|
*got_frame_ptr = 0;
|
||||||
goto finish_frame;
|
goto finish_frame;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user