diff --git a/libavformat/raw.c b/libavformat/raw.c
index dc93083e5b0ddf60d77ac1886346a2fb28338d73..3c118b36c2d7c6e00cb9322998808963a71a11c3 100644
--- a/libavformat/raw.c
+++ b/libavformat/raw.c
@@ -123,9 +123,6 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
     if (ret <= 0) {
         return AVERROR(EIO);
     }
-    /* note: we need to modify the packet size here to handle the last
-       packet */
-    pkt->size = ret;
 
     bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);
     assert(bps); // if false there IS a bug elsewhere (NOT in this function)