[vdr] [RFC] [PATCH] player.c: fix `(error) Common realloc mistake: 'buffer' nulled but not freed upon failure`

2011-02-14 Thread Paul Menzel
Date: Mon, 14 Feb 2011 14:29:48 +0100

Output of Cppcheck 1.47 [1], VDR 1.7.16:

Checking ./PLUGINS/src/pictures/player.c...
[./PLUGINS/src/pictures/player.c:9]: (debug) Include file: 
"vdr/remote.h" not found.
[./PLUGINS/src/pictures/player.c:10]: (debug) Include file: 
"vdr/tools.h" not found.
[./PLUGINS/src/pictures/player.c:70]: (error) Common realloc mistake: 
'buffer' nulled but not freed upon failure
Checking ./PLUGINS/src/pictures/player.c: BIDI...
Checking ./PLUGINS/src/pictures/player.c: DEBUGRINGBUFFERS...
Checking ./PLUGINS/src/pictures/player.c: PLUGIN_NAME_I18N...
Checking ./PLUGINS/src/pictures/player.c: __STL_CONFIG_H...
9/72 files checked 12% done

This patch uses the fix for QEMU [2] as a template and is build tested.

[1] http://cppcheck.sourceforge.net/
[2] 
http://meego.gitorious.org/qemu-maemo/qemu/commit/29718712eb2e53c09d28f08e39f6514d690f6fd3

Signed-off-by: Paul Menzel 
CC: Klaus Schmidinger 
---
Dear VDR folks,


please advise if the `break` is enough and what kind of error message
would be useful. I would then apply this fix to the whole tree and
submit a final patch.


Thanks,

Paul
---
 PLUGINS/src/pictures/player.c |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/PLUGINS/src/pictures/player.c b/PLUGINS/src/pictures/player.c
index a0123e4..3f87696 100644
--- a/PLUGINS/src/pictures/player.c
+++ b/PLUGINS/src/pictures/player.c
@@ -60,6 +60,7 @@ void cPicturePlayer::Activate(bool On)
 
 void cPicturePlayer::SetPicture(const char *FileName)
 {
+  uchar *new_buffer;
   int f = open(FileName, O_RDONLY);
   if (f >= 0) {
  for (;;) {
@@ -67,7 +68,13 @@ void cPicturePlayer::SetPicture(const char *FileName)
  if (length > 0) {
 if (length >= size) {
size = size * 3 / 2;
-   buffer = (uchar *)realloc(buffer, size);
+   new_buffer = (uchar *)realloc(buffer, size);
+   if (new_buffer == NULL) {
+  free(buffer);
+  LOG_ERROR_STR("realloc");
+  break;
+   }
+   buffer = new_buffer;
lseek(f, 0, SEEK_SET);
continue;
}
-- 
1.7.2.3


signature.asc
Description: This is a digitally signed message part
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] [PATCH] do not flag all audio tracks as "clean effects" in remux.c

2011-02-14 Thread Anssi Hannula
Hi!

cPatPmtGenerator::MakeLanguageDescriptor in remux.c incorrectly flags
all audio tracks as "clean effects", which means a track without any
voice or language.

The proper solution would be to preserve the audio_type of the original
stream (which may indicate e.g. a visual-impaired audio track, as used
for e.g. automated subtitles-to-speech audio tracks by YLE here in Finland).

The attached patch is a simpler stop-gap measure that simply always sets
the audio_type to the value of 0x00 which means a "normal" track, which
is obviously better than marking the track as a special "clean effects" one.

-- 
Anssi Hannula
--- vdr-1.7.16/remux.c	2010-06-05 16:32:15.0 +0300
+++ vdr-1.7.16-m/remux.c	2011-02-14 19:37:58.575610709 +0200
@@ -225,7 +225,7 @@
   Target[i++] = *Language++;
   Target[i++] = *Language++;
   Target[i++] = *Language++;
-  Target[i++] = 0x01; // audio type
+  Target[i++] = 0x00; // audio type
   Target[Length] += 0x04; // length
   if (*Language == '+')
  Language++;
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] VDR 1.7.16 FF card crashes

2011-02-14 Thread Udo Richter
Am 14.02.2011 01:33, schrieb syrius...@no-log.org:
> Udo Richter  writes:
>> Using 1.7.16 on an unmodified FF DVB-S regularly, no special issues.
>> Rock solid as usual, as long as you don't do transfer mode on high
>> bandwidth channels.
> 
> Are you still using it as a primary device with its mpeg decoder and
> video output ?

Yes, its still the primary output device. I'm using it together with an
budget SAT card. The card does live view, playback and transfer mode,
using the VDR 1.7 TS output device mode.

When recording using both devices, I make sure that output is suspended,
to avoid bandwidth overloads. Thats the only issue I have.

> This is an old rev1.5 card, I guess it was never meant to be used like
> this.

r1.6 card using fe2624 firmware, stock debian backports 2.6.32-bpo.5
kernel. Last reboot in december, right after installing the kernel.


Cheers,

Udo

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] Email problem - who is the postmaster?

2011-02-14 Thread Scott Waye

 Hi,

What is the postmaster email address for this list?  I get some of the 
messages 7 times 20 minutes apart.


--
Scott

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr