diff --git a/libavformat/rtpdec_hevc.c b/libavformat/rtpdec_hevc.c
index f677733a0a..ac4c7656d4 100644
--- a/libavformat/rtpdec_hevc.c
+++ b/libavformat/rtpdec_hevc.c
@@ -361,8 +361,6 @@ static int hevc_handle_packet(AVFormatContext *ctx, PayloadContext *rtp_hevc_ctx
         buf += RTP_HEVC_PAYLOAD_HEADER_SIZE;
         len -= RTP_HEVC_PAYLOAD_HEADER_SIZE;
 
-        if (len < 1)
-            return AVERROR_INVALIDDATA;
         /*
              decode the FU header