Skip to content

Commit

Permalink
[demuxers/MpegPS] Ensure we read at least PROBE_MIN_SIZE bytes to det…
Browse files Browse the repository at this point in the history
…ect audio
  • Loading branch information
eumagga0x2a committed Sep 30, 2019
1 parent c1167fb commit 7eb6ae3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion avidemux_plugins/ADM_demuxers/MpegPS/ADM_psAudioProbe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ uint8_t audioBuffer[PROBE_ANALYZE_SIZE];
//Realign
p->seek(startAt,0);
int rd=packetSize*2;
if(rd<PROBE_MIN_SIZE) rd=PROBE_MIN_SIZE;
if(rd>PROBE_ANALYZE_SIZE) rd=PROBE_ANALYZE_SIZE;
if(!p->read(rd,audioBuffer))
{
ADM_info("Cannot read %d bytes of type %x\n",packetSize*2,pid);
ADM_info("Cannot read %d bytes of type %x\n",rd,pid);
return false;
}
psAudioTrackInfo *info=new psAudioTrackInfo;
Expand Down

0 comments on commit 7eb6ae3

Please sign in to comment.