You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avutil/frame: Always return error upon error
(I don't know whether this can be triggered for a file with nonnegative channel count, given that src's extended data can't have been allocated in this case.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -456,14 +456,11 @@ int av_frame_replace(AVFrame *dst, const AVFrame *src)
|
||||
if (src->extended_data != src->data) {
|
||||
int ch = dst->ch_layout.nb_channels;
|
||||
|
||||
if (!ch) {
|
||||
if (ch <= 0 || ch > SIZE_MAX / sizeof(*dst->extended_data)) {
|
||||
ret = AVERROR(EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (ch > SIZE_MAX / sizeof(*dst->extended_data))
|
||||
goto fail;
|
||||
|
||||
dst->extended_data = av_memdup(src->extended_data, sizeof(*dst->extended_data) * ch);
|
||||
if (!dst->extended_data) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
|
Reference in New Issue
Block a user