mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-18 22:55:12 +08:00
Revert "libutvideodec: Make buf_size local"
This change was dependent on a different patch that
never actually made it into FFmpeg, and it actually
ended up breaking builds.
This reverts commit 70cf7bb958
.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
dd7453a24e
commit
69035f3ec7
@@ -43,6 +43,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CCodec *codec;
|
CCodec *codec;
|
||||||
|
unsigned int buf_size;
|
||||||
uint8_t *output;
|
uint8_t *output;
|
||||||
} UtVideoContext;
|
} UtVideoContext;
|
||||||
|
|
||||||
@@ -52,7 +53,6 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
|
|||||||
UtVideoExtra info;
|
UtVideoExtra info;
|
||||||
int format;
|
int format;
|
||||||
int begin_ret;
|
int begin_ret;
|
||||||
unsigned int buf_size;
|
|
||||||
|
|
||||||
if (avctx->extradata_size != 4*4) {
|
if (avctx->extradata_size != 4*4) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Extradata size mismatch.\n");
|
av_log(avctx, AV_LOG_ERROR, "Extradata size mismatch.\n");
|
||||||
@@ -90,8 +90,8 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Only allocate the buffer once */
|
/* Only allocate the buffer once */
|
||||||
buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
|
utv->buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
|
||||||
utv->output = (uint8_t *)av_malloc(buf_size * sizeof(uint8_t));
|
utv->output = (uint8_t *)av_malloc(utv->buf_size * sizeof(uint8_t));
|
||||||
|
|
||||||
if (utv->output == NULL) {
|
if (utv->output == NULL) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unable to allocate output buffer.\n");
|
av_log(avctx, AV_LOG_ERROR, "Unable to allocate output buffer.\n");
|
||||||
|
Reference in New Issue
Block a user