Commit 392d975e authored by Paul B Mahol's avatar Paul B Mahol

avcodec: fix clobbered ff_get_buffer()

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 9b22e460
...@@ -333,10 +333,8 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, ...@@ -333,10 +333,8 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
float **samples_p = (float **)frame->extended_data; float **samples_p = (float **)frame->extended_data;
frame->nb_samples = ATRAC3P_FRAME_SAMPLES; frame->nb_samples = ATRAC3P_FRAME_SAMPLES;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret; return ret;
}
if ((ret = init_get_bits8(&ctx->gb, avpkt->data, avpkt->size)) < 0) if ((ret = init_get_bits8(&ctx->gb, avpkt->data, avpkt->size)) < 0)
return ret; return ret;
......
...@@ -266,10 +266,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, ...@@ -266,10 +266,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
int skip_cursor = 0; int skip_cursor = 0;
uint8_t *sdata; uint8_t *sdata;
if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0) { if ((ret = ff_reget_buffer(avctx, ctx->frame)) < 0)
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret; return ret;
}
/* Header + at least one slice (4) */ /* Header + at least one slice (4) */
if (avpkt->size < FIC_HEADER_SIZE + 4) { if (avpkt->size < FIC_HEADER_SIZE + 4) {
......
...@@ -848,10 +848,8 @@ static int on2avc_decode_frame(AVCodecContext * avctx, void *data, ...@@ -848,10 +848,8 @@ static int on2avc_decode_frame(AVCodecContext * avctx, void *data,
if (c->is_av500) { if (c->is_av500) {
/* get output buffer */ /* get output buffer */
frame->nb_samples = ON2AVC_SUBFRAME_SIZE; frame->nb_samples = ON2AVC_SUBFRAME_SIZE;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret; return ret;
}
if ((ret = on2avc_decode_subframe(c, buf, buf_size, frame, 0)) < 0) if ((ret = on2avc_decode_subframe(c, buf, buf_size, frame, 0)) < 0)
return ret; return ret;
...@@ -874,10 +872,8 @@ static int on2avc_decode_frame(AVCodecContext * avctx, void *data, ...@@ -874,10 +872,8 @@ static int on2avc_decode_frame(AVCodecContext * avctx, void *data,
/* get output buffer */ /* get output buffer */
frame->nb_samples = ON2AVC_SUBFRAME_SIZE * num_frames; frame->nb_samples = ON2AVC_SUBFRAME_SIZE * num_frames;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret; return ret;
}
audio_off = 0; audio_off = 0;
bytestream2_init(&gb, buf, buf_size); bytestream2_init(&gb, buf, buf_size);
......
...@@ -474,10 +474,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, ...@@ -474,10 +474,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
/* setup the data buffers */ /* setup the data buffers */
ret = ff_get_buffer(avctx, frame, 0); ret = ff_get_buffer(avctx, frame, 0);
if (ret < 0) { if (ret < 0)
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret; return ret;
}
frame->nb_samples = 0; frame->nb_samples = 0;
for (i = 0; i < avctx->channels; i++) { for (i = 0; i < avctx->channels; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment