diff mbox series

[FFmpeg-devel,3/4] avformat/ilbc: Use av_get_packet

Message ID 20210203102749.473999-3-andreas.rheinhardt@gmail.com
State Accepted
Commit a3e78deb0a3a0142d333808678b6ee70873ecab7
Headers show
Series [FFmpeg-devel,1/4] Remove unnecessary mem.h inclusions | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Feb. 3, 2021, 10:27 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/ilbc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/ilbc.c b/libavformat/ilbc.c
index 188c0f091a..bee3954f9c 100644
--- a/libavformat/ilbc.c
+++ b/libavformat/ilbc.c
@@ -99,15 +99,11 @@  static int ilbc_read_packet(AVFormatContext *s,
     AVCodecParameters *par = s->streams[0]->codecpar;
     int ret;
 
-    if ((ret = av_new_packet(pkt, par->block_align)) < 0)
-        return ret;
+    if ((ret = av_get_packet(s->pb, pkt, par->block_align)) != par->block_align)
+        return ret < 0 ? ret : AVERROR_INVALIDDATA;
 
     pkt->stream_index = 0;
-    pkt->pos = avio_tell(s->pb);
     pkt->duration = par->block_align == 38 ? 160 : 240;
-    if ((ret = avio_read(s->pb, pkt->data, par->block_align)) != par->block_align) {
-        return ret < 0 ? ret : AVERROR(EIO);
-    }
 
     return 0;
 }