On Thu, 7 May 2020, [email protected] wrote:
From: Limin Wang <[email protected]>
Signed-off-by: Limin Wang <[email protected]>
---
libavcodec/mpegvideo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index b5ddb1b..8a74a45 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -359,7 +359,7 @@ static int init_duplicate_context(MpegEncContext *s)
int y_size = s->b8_stride * (2 * s->mb_height + 1);
int c_size = s->mb_stride * (s->mb_height + 1);
int yc_size = y_size + 2 * c_size;
- int i;
+ int i, ret = AVERROR(ENOMEM);
ret is uncecessary.
if (s->mb_height & 1)
yc_size += 2*s->b8_stride + 2*s->mb_stride;
@@ -408,7 +408,7 @@ static int init_duplicate_context(MpegEncContext *s)
return 0;
fail:
- return -1; // free() through ff_mpv_common_end()
+ return ret; // free() through ff_mpv_common_end()
Simply return AVERROR(ENOMEM) because all failures are ENOMEM-s.
}
static void free_duplicate_context(MpegEncContext *s)
--
Regards,
Marton
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".