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:
Zhao Zhili
2026-05-14 21:46:21 +08:00
committed by Zhao Zhili
parent 989e621bcd
commit b4d11dffbf
+3 -7
View File
@@ -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