Commit dcdc1cbf authored by Thomas Volkert's avatar Thomas Volkert Committed by Michael Niedermayer

rtpdec_hevc: do not print an error message if the received packet has a valid...

rtpdec_hevc: do not print an error message if the received packet has a valid header but lacks additional bytes as payload
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6c7f1155
...@@ -300,6 +300,7 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx ...@@ -300,6 +300,7 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
av_dlog(ctx, " FU type %d with %d bytes\n", fu_type, len); av_dlog(ctx, " FU type %d with %d bytes\n", fu_type, len);
/* sanity check for size of input packet: 1 byte payload at least */
if (len > 0) { if (len > 0) {
new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1); new_nal_header[0] = (rtp_pl[0] & 0x81) | (fu_type << 1);
new_nal_header[1] = rtp_pl[1]; new_nal_header[1] = rtp_pl[1];
...@@ -328,11 +329,14 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx ...@@ -328,11 +329,14 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
memcpy(pkt->data, buf, len); memcpy(pkt->data, buf, len);
} }
} else { } else {
/* sanity check for size of input packet: 1 byte payload at least */ if (len < 0) {
av_log(ctx, AV_LOG_ERROR, av_log(ctx, AV_LOG_ERROR,
"Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n", "Too short RTP/HEVC packet, got %d bytes of NAL unit type %d\n",
len, nal_type); len, nal_type);
res = AVERROR_INVALIDDATA; res = AVERROR_INVALIDDATA;
} else {
res = AVERROR(EAGAIN);
}
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment