diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-03-21 00:18:45 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-03-21 00:18:45 +0000 |
| commit | 90e70d5d028b1bac369c2f4742b84e11f66435b7 (patch) | |
| tree | a774669ba0c5fcd391d9afc1a1e964fc936cddad /lib/dvb/decoder.cpp | |
| parent | ed94aebfba0372444928338ef479b399aa9bcbfc (diff) | |
| download | enigma2-90e70d5d028b1bac369c2f4742b84e11f66435b7.tar.gz enigma2-90e70d5d028b1bac369c2f4742b84e11f66435b7.zip | |
fix memory corruption on showSinglePic
Diffstat (limited to 'lib/dvb/decoder.cpp')
| -rw-r--r-- | lib/dvb/decoder.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/dvb/decoder.cpp b/lib/dvb/decoder.cpp index fdd3f872..beec1078 100644 --- a/lib/dvb/decoder.cpp +++ b/lib/dvb/decoder.cpp @@ -846,20 +846,20 @@ RESULT eTSMPEGDecoder::showSinglePic(const char *filename) { int rd; fseek(f, 0, SEEK_SET); + if (!cnt) + { + buffer[pos++]=0; + buffer[pos++]=0; + buffer[pos++]=1; + buffer[pos++]=0xE0; + buffer[pos++]=(length*3)>>8; + buffer[pos++]=(length*3)&0xFF; + buffer[pos++]=0x80; + buffer[pos++]=0; + buffer[pos++]=0; + } while(1) { - if (!cnt) - { - buffer[pos++]=0; - buffer[pos++]=0; - buffer[pos++]=1; - buffer[pos++]=0xE0; - buffer[pos++]=(length*3)>>8; - buffer[pos++]=(length*3)&0xFF; - buffer[pos++]=0x80; - buffer[pos++]=0; - buffer[pos++]=0; - } rd = fread(buffer+pos, 1, length, f); if (rd > 0) pos += rd; |
