mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
avformat/rtpdec_av1: fix operator precedence in packet allocation
The closing parenthesis in the av_new_packet() branch was misplaced, making result store the boolean comparison instead of the AVERROR code, so allocation failures were silently lost. av_grow_packet() handles both an empty and a non-empty packet, so use it for both cases and drop the broken branch. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
@@ -278,13 +278,9 @@ static int av1_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
||||
if (data->needs_td) {
|
||||
output_size += 2; // for Temporal Delimiter (TD)
|
||||
}
|
||||
if (pkt->data) {
|
||||
if ((result = av_grow_packet(pkt, output_size)) < 0)
|
||||
return result;
|
||||
} else {
|
||||
if ((result = av_new_packet(pkt, output_size) < 0))
|
||||
return result;
|
||||
}
|
||||
result = av_grow_packet(pkt, output_size);
|
||||
if (result < 0)
|
||||
return result;
|
||||
|
||||
if (data->needs_td) {
|
||||
// restore TD
|
||||
|
||||
Reference in New Issue
Block a user