mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
lavc/libx264: do not ignore memory allocation errors
This commit is contained in:
parent
cccd2c2179
commit
e17b609fc6
@ -468,14 +468,16 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame,
|
||||
size_t sei_size;
|
||||
|
||||
ret = ff_alloc_a53_sei(frame, 0, &sei_data, &sei_size);
|
||||
if (ret < 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");
|
||||
} else if (sei_data) {
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
if (sei_data) {
|
||||
pic->extra_sei.payloads = av_mallocz(sizeof(pic->extra_sei.payloads[0]));
|
||||
if (pic->extra_sei.payloads == NULL) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");
|
||||
av_free(sei_data);
|
||||
} else {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
pic->extra_sei.sei_free = av_free;
|
||||
|
||||
pic->extra_sei.payloads[0].payload_size = sei_size;
|
||||
@ -484,7 +486,6 @@ static int setup_frame(AVCodecContext *ctx, const AVFrame *frame,
|
||||
pic->extra_sei.payloads[0].payload_type = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_REGIONS_OF_INTEREST);
|
||||
if (sd) {
|
||||
|
Loading…
Reference in New Issue
Block a user